public class LocalScopePrefixExtractor extends Object
scope
claim of a JWT and returns it as a
Set
of Authorization
s.Constructor and Description |
---|
LocalScopePrefixExtractor(LocalScopePrefixProvider localScopePrefixProvider)
Creates a new instance with the given
LocalScopePrefixProvider which provides the prefix of the scopes to
be used. |
Modifier and Type | Method and Description |
---|---|
io.vavr.control.Try<Set<Authorization>> |
getAuthorizations(com.auth0.jwt.interfaces.Payload jwt)
Extracts the authorizations from the given JWT.
|
public LocalScopePrefixExtractor(@Nullable LocalScopePrefixProvider localScopePrefixProvider)
LocalScopePrefixProvider
which provides the prefix of the scopes to
be used.localScopePrefixProvider
- The provider for the prefix of relevant scopes.@Nonnull public io.vavr.control.Try<Set<Authorization>> getAuthorizations(@Nonnull com.auth0.jwt.interfaces.Payload jwt)
For that the method takes all scope entries, removes all without the prefix given in the constructor and removes the prefix afterwards.
jwt
- The JWT to extract the scopes fromTry
with a set of all scopes as Authorization
objects.Copyright © 2019 SAP SE. All rights reserved.