public class DefaultAuthTokenFacade extends Object implements AuthTokenFacade
AuthToken
.Constructor and Description |
---|
DefaultAuthTokenFacade()
Default constructor.
|
DefaultAuthTokenFacade(com.sap.cloud.security.xsuaa.client.OAuth2TokenService tokenService,
com.sap.cloud.security.config.OAuth2ServiceConfiguration xsuaaConfiguration)
Create a new
DefaultAuthTokenFacade with the given token serivce and an
OAuth2ServiceConfiguration . |
Modifier and Type | Method and Description |
---|---|
Future<String> |
getRefreshToken(com.auth0.jwt.interfaces.DecodedJWT jwt)
Returns a
Future that resolves to a refresh token. |
io.vavr.control.Try<AuthToken> |
tryGetCurrentToken()
Returns a
Try of the current AuthToken . |
io.vavr.control.Try<AuthToken> |
tryGetXsuaaServiceToken()
Retrieves a validated authentication token from the bound XSUAA instance.
|
public DefaultAuthTokenFacade()
public DefaultAuthTokenFacade(@Nonnull com.sap.cloud.security.xsuaa.client.OAuth2TokenService tokenService, @Nullable com.sap.cloud.security.config.OAuth2ServiceConfiguration xsuaaConfiguration)
DefaultAuthTokenFacade
with the given token serivce and an
OAuth2ServiceConfiguration
. The latter will be used to construct a validator for auth token validation.tokenService
- The OAuth2TokenService
to be used.xsuaaConfiguration
- The XSUAA configuration to be used.@Nonnull public io.vavr.control.Try<AuthToken> tryGetCurrentToken()
Try
of the current AuthToken
. An AuthToken
is not available if no request is
available or the request does not contain an "Authorization" header.tryGetCurrentToken
in interface AuthTokenFacade
Try
of the current AuthToken
.@Nonnull public io.vavr.control.Try<AuthToken> tryGetXsuaaServiceToken()
tryGetXsuaaServiceToken
in interface AuthTokenFacade
Try
of the XSUAA authentication token.@Nonnull public Future<String> getRefreshToken(@Nonnull com.auth0.jwt.interfaces.DecodedJWT jwt)
Future
that resolves to a refresh token.getRefreshToken
in interface AuthTokenFacade
jwt
- The decoded JWT instance to resolve a refresh token for.Future
that resolves to a refresh token.Copyright © 2021 SAP SE. All rights reserved.