Class XsuaaOAuth2TokenService
java.lang.Object
com.sap.cloud.security.xsuaa.client.AbstractOAuth2TokenService
com.sap.cloud.security.xsuaa.client.XsuaaOAuth2TokenService
- All Implemented Interfaces:
OAuth2TokenService,Cacheable
Implementation for Spring applications, that uses
RestOperations.-
Constructor Summary
ConstructorsConstructorDescriptionXsuaaOAuth2TokenService(org.springframework.web.client.RestOperations restOperations) XsuaaOAuth2TokenService(org.springframework.web.client.RestOperations restOperations, 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
-
XsuaaOAuth2TokenService
public XsuaaOAuth2TokenService(@Nonnull org.springframework.web.client.RestOperations restOperations) -
XsuaaOAuth2TokenService
public XsuaaOAuth2TokenService(@Nonnull org.springframework.web.client.RestOperations restOperations, @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.
-