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
public class XsuaaTokenAuthenticator extends AbstractTokenAuthenticator
-
-
Field Summary
-
Fields inherited from class com.sap.cloud.security.servlet.AbstractTokenAuthenticator
httpClient, serviceConfiguration
-
-
Constructor Summary
Constructors Constructor Description XsuaaTokenAuthenticator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TokenAuthenticationResultauthenticated(Token token)TokenextractFromHeader(String authorizationHeader)Extracts theTokenfrom the authorization header.protected OAuth2ServiceConfigurationgetOtherServiceConfiguration()Return other configured service configurations or null if not configured.protected OAuth2ServiceConfigurationgetServiceConfiguration()Return configured service configuration or Environments.getCurrent() if not configured.TokenAuthenticationResultvalidateRequest(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)AbstractTokenAuthenticatorwithHttpClient(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.AbstractTokenAuthenticatorwithServiceConfiguration(OAuth2ServiceConfiguration serviceConfiguration)Use to override the service configuration used.-
Methods inherited from class com.sap.cloud.security.servlet.AbstractTokenAuthenticator
withCacheConfiguration, withValidationListener
-
-
-
-
Method Detail
-
withServiceConfiguration
public AbstractTokenAuthenticator withServiceConfiguration(OAuth2ServiceConfiguration serviceConfiguration)
Description copied from class:AbstractTokenAuthenticatorUse to override the service configuration used.- Overrides:
withServiceConfigurationin 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:AbstractTokenAuthenticatorUse to configure the HttpClient that is used to retrieve token keys or to perform a token-exchange.- Overrides:
withHttpClientin classAbstractTokenAuthenticator- Parameters:
httpClient- the HttpClient- Returns:
- this authenticator
-
extractFromHeader
public Token extractFromHeader(String authorizationHeader)
Description copied from class:AbstractTokenAuthenticatorExtracts theTokenfrom the authorization header.- Specified by:
extractFromHeaderin classAbstractTokenAuthenticator- Parameters:
authorizationHeader- the value of the 'Authorization' request header- Returns:
- the
Tokeninstance.
-
getServiceConfiguration
protected OAuth2ServiceConfiguration getServiceConfiguration()
Description copied from class:AbstractTokenAuthenticatorReturn configured service configuration or Environments.getCurrent() if not configured.- Specified by:
getServiceConfigurationin classAbstractTokenAuthenticator- Returns:
- the actual service configuration
-
getOtherServiceConfiguration
@Nullable protected OAuth2ServiceConfiguration getOtherServiceConfiguration()
Description copied from class:AbstractTokenAuthenticatorReturn other configured service configurations or null if not configured.- Specified by:
getOtherServiceConfigurationin classAbstractTokenAuthenticator- Returns:
- the other service configuration or null
-
authenticated
protected TokenAuthenticationResult authenticated(Token token)
- Overrides:
authenticatedin classAbstractTokenAuthenticator
-
validateRequest
public TokenAuthenticationResult validateRequest(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
- Specified by:
validateRequestin interfaceTokenAuthenticator- Overrides:
validateRequestin classAbstractTokenAuthenticator
-
-