Class DefaultOAuth2TokenService
- java.lang.Object
-
- com.sap.cloud.security.xsuaa.client.AbstractOAuth2TokenService
-
- com.sap.cloud.security.xsuaa.client.DefaultOAuth2TokenService
-
- All Implemented Interfaces:
OAuth2TokenService,Cacheable
public class DefaultOAuth2TokenService extends AbstractOAuth2TokenService
-
-
Constructor Summary
Constructors Constructor Description DefaultOAuth2TokenService()Deprecated.in favor ofDefaultOAuth2TokenService(CloseableHttpClient)as it doesn't support certificate based communication.DefaultOAuth2TokenService(TokenCacheConfiguration tokenCacheConfiguration)Deprecated.in favor ofDefaultOAuth2TokenService(CloseableHttpClient, TokenCacheConfiguration)as it doesn't support certificate based communication.DefaultOAuth2TokenService(org.apache.http.impl.client.CloseableHttpClient httpClient)DefaultOAuth2TokenService(org.apache.http.impl.client.CloseableHttpClient httpClient, TokenCacheConfiguration tokenCacheConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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, retrieveAccessTokenViaUserTokenGrant
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sap.cloud.security.xsuaa.client.OAuth2TokenService
retrieveAccessTokenViaClientCredentialsGrant, retrieveAccessTokenViaClientCredentialsGrant, retrieveAccessTokenViaJwtBearerTokenGrant, retrieveAccessTokenViaPasswordGrant, retrieveAccessTokenViaRefreshToken
-
-
-
-
Constructor Detail
-
DefaultOAuth2TokenService
@Deprecated public DefaultOAuth2TokenService()
Deprecated.in favor ofDefaultOAuth2TokenService(CloseableHttpClient)as it doesn't support certificate based communication. Will be deleted with version 3.0.0.
-
DefaultOAuth2TokenService
public DefaultOAuth2TokenService(@Nonnull org.apache.http.impl.client.CloseableHttpClient httpClient)
-
DefaultOAuth2TokenService
@Deprecated public DefaultOAuth2TokenService(@Nonnull TokenCacheConfiguration tokenCacheConfiguration)
Deprecated.in favor ofDefaultOAuth2TokenService(CloseableHttpClient, TokenCacheConfiguration)as it doesn't support certificate based communication. Will be deleted with version 3.0.0.
-
DefaultOAuth2TokenService
public DefaultOAuth2TokenService(@Nonnull org.apache.http.impl.client.CloseableHttpClient httpClient, @Nonnull TokenCacheConfiguration tokenCacheConfiguration)
-
-
Method Detail
-
requestAccessToken
protected OAuth2TokenResponse requestAccessToken(URI tokenEndpointUri, HttpHeaders headers, Map<String,String> parameters) throws OAuth2ServiceException
Description 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.
-
-