Package com.sap.cloud.security.servlet
Class XsuaaTokenAuthenticator
java.lang.Object
com.sap.cloud.security.servlet.AbstractTokenAuthenticator
com.sap.cloud.security.servlet.XsuaaTokenAuthenticator
- All Implemented Interfaces:
TokenAuthenticator
-
Field Summary
Fields inherited from class com.sap.cloud.security.servlet.AbstractTokenAuthenticator
httpClient, serviceConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TokenAuthenticationResult
authenticated
(Token token) extractFromHeader
(String authorizationHeader) Extracts theToken
from the authorization header.protected OAuth2ServiceConfiguration
Return other configured service configurations or null if not configured.protected OAuth2ServiceConfiguration
Return configured service configuration or Environments.getCurrent() if not configured.validateRequest
(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) withHttpClient
(org.apache.http.impl.client.CloseableHttpClient httpClient) Use to configure the HttpClient that is used to retrieve token keys or to perform a token-exchange.withServiceConfiguration
(OAuth2ServiceConfiguration serviceConfiguration) Use to override the service configuration used.Methods inherited from class com.sap.cloud.security.servlet.AbstractTokenAuthenticator
withCacheConfiguration, withValidationListener
-
Constructor Details
-
XsuaaTokenAuthenticator
public XsuaaTokenAuthenticator()
-
-
Method Details
-
withServiceConfiguration
public AbstractTokenAuthenticator withServiceConfiguration(OAuth2ServiceConfiguration serviceConfiguration) Description copied from class:AbstractTokenAuthenticator
Use to override the service configuration used.- Overrides:
withServiceConfiguration
in classAbstractTokenAuthenticator
- Parameters:
serviceConfiguration
- the service configuration to use- Returns:
- this authenticator
-
withHttpClient
public AbstractTokenAuthenticator withHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient) Description copied from class:AbstractTokenAuthenticator
Use to configure the HttpClient that is used to retrieve token keys or to perform a token-exchange.- Overrides:
withHttpClient
in classAbstractTokenAuthenticator
- Parameters:
httpClient
- the HttpClient- Returns:
- this authenticator
-
extractFromHeader
Description copied from class:AbstractTokenAuthenticator
Extracts theToken
from the authorization header.- Specified by:
extractFromHeader
in classAbstractTokenAuthenticator
- Parameters:
authorizationHeader
- the value of the 'Authorization' request header- Returns:
- the
Token
instance.
-
getServiceConfiguration
Description copied from class:AbstractTokenAuthenticator
Return configured service configuration or Environments.getCurrent() if not configured.- Specified by:
getServiceConfiguration
in classAbstractTokenAuthenticator
- Returns:
- the actual service configuration
-
getOtherServiceConfiguration
Description copied from class:AbstractTokenAuthenticator
Return other configured service configurations or null if not configured.- Specified by:
getOtherServiceConfiguration
in classAbstractTokenAuthenticator
- Returns:
- the other service configuration or null
-
authenticated
- Overrides:
authenticated
in classAbstractTokenAuthenticator
-
validateRequest
public TokenAuthenticationResult validateRequest(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) - Specified by:
validateRequest
in interfaceTokenAuthenticator
- Overrides:
validateRequest
in classAbstractTokenAuthenticator
-