public class LocalScopePrefixExtractor extends Object
scope claim of a JWT and returns it as a
Set of Authorizations.| Constructor and Description |
|---|
LocalScopePrefixExtractor(LocalScopePrefixProvider prefixProvider)
Creates a new instance with the given
LocalScopePrefixProvider which provides the prefix of the scopes to
be used. |
| Modifier and Type | Method and Description |
|---|---|
Set<Authorization> |
getAuthorizations(com.auth0.jwt.interfaces.Payload jwt)
Extracts the authorizations from the given JWT.
|
public LocalScopePrefixExtractor(@Nullable LocalScopePrefixProvider prefixProvider)
LocalScopePrefixProvider which provides the prefix of the scopes to
be used.prefixProvider - The provider for the prefix of relevant scopes.@Nonnull public Set<Authorization> getAuthorizations(@Nonnull com.auth0.jwt.interfaces.Payload jwt) throws ScopeAccessException
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 fromAuthorization objects.ScopeAccessException - If the value of the scope claim of the JWT does not contain a list of Strings.Copyright © 2019 SAP SE. All rights reserved.