Class LocalScopePrefixExtractor

java.lang.Object
com.sap.cloud.sdk.cloudplatform.security.principal.LocalScopePrefixExtractor

@Deprecated public class LocalScopePrefixExtractor extends Object
Deprecated.
To be removed without replacement. Please refer to release notes for more information.
This class contains the logic to extract the values of the scope claim of a JWT and returns it as a Set of Authorizations.
  • Constructor Details

    • LocalScopePrefixExtractor

      public LocalScopePrefixExtractor(@Nullable LocalScopePrefixProvider localScopePrefixProvider)
      Deprecated.
      Creates a new instance with the given LocalScopePrefixProvider which provides the prefix of the scopes to be used.
      Parameters:
      localScopePrefixProvider - The provider for the prefix of relevant scopes.
  • Method Details

    • getAuthorizations

      @Nonnull public io.vavr.control.Try<Set<Authorization>> getAuthorizations(@Nonnull com.auth0.jwt.interfaces.Payload jwt)
      Deprecated.
      Extracts the authorizations from the given JWT.

      For that the method takes all scope entries, removes all without the prefix given in the constructor and removes the prefix afterwards.

      Parameters:
      jwt - The JWT to extract the scopes from
      Returns:
      A Try with a set of all scopes as Authorization objects.