Class ScpCfAuthTokenFacade

java.lang.Object
com.sap.cloud.sdk.cloudplatform.security.ScpCfAuthTokenFacade
All Implemented Interfaces:
AuthTokenFacade

public class ScpCfAuthTokenFacade extends Object
Facade for retrieving the current AuthToken.
  • Constructor Details

    • ScpCfAuthTokenFacade

      public ScpCfAuthTokenFacade()
      Default constructor.
    • ScpCfAuthTokenFacade

      @Deprecated public ScpCfAuthTokenFacade(@Nonnull com.sap.cloud.security.xsuaa.client.OAuth2TokenService tokenService, @Nullable com.sap.cloud.security.config.OAuth2ServiceConfiguration oauth2Configuration)
      Deprecated.
      Token validation will be removed with the next major release. Please leverage the security library directly instead.
      Create a new ScpCfAuthTokenFacade with the given token service and an OAuth2ServiceConfiguration. The latter will be used to construct a validator for auth token validation.
      Parameters:
      tokenService - The OAuth2TokenService to be used.
      oauth2Configuration - The OAuth2 configuration to be used.
  • Method Details

    • tryGetCurrentToken

      @Nonnull public io.vavr.control.Try<AuthToken> tryGetCurrentToken()
    • tryGetXsuaaServiceToken

      @Nonnull @Deprecated public io.vavr.control.Try<AuthToken> tryGetXsuaaServiceToken()
      Deprecated.
      Please leverage the XSUAA Security Library directly instead.
      Attempts to retrieve an auth token for the provider account for a technical user. This method is not compatible with version 3.0.0 or higher of the XSUAA Security Library
      Returns:
      An auth token or a failure.
    • getRefreshToken

      @Nonnull @Deprecated public Future<String> getRefreshToken(@Nonnull com.auth0.jwt.interfaces.DecodedJWT jwt)
      Deprecated.
      Please leverage the security library directly instead.
      Asynchronously resolve a new refresh token on behalf of a given JWT.
      Parameters:
      jwt - The JWT.
      Returns:
      A new refresh token.
    • executeWithAuthToken

      @Nullable protected <T> T executeWithAuthToken(@Nonnull AuthToken authToken, @Nonnull Callable<T> callable) throws ThreadContextExecutionException
      Throws:
      ThreadContextExecutionException