Class DefaultOAuth2TokenService
java.lang.Object
com.sap.cloud.security.xsuaa.client.AbstractOAuth2TokenService
com.sap.cloud.security.xsuaa.client.DefaultOAuth2TokenService
- All Implemented Interfaces:
OAuth2TokenService,Cacheable
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultOAuth2TokenService(org.apache.http.impl.client.CloseableHttpClient httpClient) DefaultOAuth2TokenService(org.apache.http.impl.client.CloseableHttpClient httpClient, TokenCacheConfiguration tokenCacheConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionprotected OAuth2TokenResponserequestAccessToken(URI tokenEndpointUri, HttpHeaders headers, Map<String, String> parameters) Implements the HTTP client specific logic to perform an HTTP request and handle the response.Methods inherited from class com.sap.cloud.security.xsuaa.client.AbstractOAuth2TokenService
clearCache, getCacheConfiguration, getCacheStatistics, getClock, retrieveAccessTokenViaClientCredentialsGrant, retrieveAccessTokenViaJwtBearerTokenGrant, retrieveAccessTokenViaJwtBearerTokenGrant, retrieveAccessTokenViaPasswordGrant, retrieveAccessTokenViaRefreshToken
-
Constructor Details
-
DefaultOAuth2TokenService
public DefaultOAuth2TokenService(@Nonnull org.apache.http.impl.client.CloseableHttpClient httpClient) -
DefaultOAuth2TokenService
public DefaultOAuth2TokenService(@Nonnull org.apache.http.impl.client.CloseableHttpClient httpClient, @Nonnull TokenCacheConfiguration tokenCacheConfiguration)
-
-
Method Details
-
requestAccessToken
protected OAuth2TokenResponse requestAccessToken(URI tokenEndpointUri, HttpHeaders headers, Map<String, String> parameters) throws OAuth2ServiceExceptionDescription copied from class:AbstractOAuth2TokenServiceImplements the HTTP client specific logic to perform an HTTP request and handle the response.- Specified by:
requestAccessTokenin classAbstractOAuth2TokenService- Parameters:
tokenEndpointUri- the URI of the token endpoint the request must be sent to.headers- the HTTP headers that must be sent with the request.parameters- a map of request parameters that must be sent with the request.- Returns:
- the token response.
- Throws:
OAuth2ServiceException- when the request ot the token endpoint fails or returns an error code.
-