Class XsuaaOAuth2TokenService
- java.lang.Object
-
- com.sap.cloud.security.xsuaa.client.AbstractOAuth2TokenService
-
- com.sap.cloud.security.xsuaa.client.XsuaaOAuth2TokenService
-
- All Implemented Interfaces:
OAuth2TokenService,Cacheable
public class XsuaaOAuth2TokenService extends AbstractOAuth2TokenService
Implementation for Spring applications, that usesRestOperations.
-
-
Constructor Summary
Constructors Constructor Description XsuaaOAuth2TokenService()Deprecated.In favor of {XsuaaOAuth2TokenService(RestOperations)gets removed with the version 3.0.0, does not support certificate based authenticationXsuaaOAuth2TokenService(TokenCacheConfiguration tokenCacheConfiguration)Deprecated.In favor of {XsuaaOAuth2TokenService(RestOperations)gets removed with the version 3.0.0, does not support certificate based authenticationXsuaaOAuth2TokenService(org.springframework.web.client.RestOperations restOperations)XsuaaOAuth2TokenService(org.springframework.web.client.RestOperations restOperations, 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
-
XsuaaOAuth2TokenService
@Deprecated public XsuaaOAuth2TokenService()
Deprecated.In favor of {XsuaaOAuth2TokenService(RestOperations)gets removed with the version 3.0.0, does not support certificate based authentication
-
XsuaaOAuth2TokenService
@Deprecated public XsuaaOAuth2TokenService(@Nonnull TokenCacheConfiguration tokenCacheConfiguration)
Deprecated.In favor of {XsuaaOAuth2TokenService(RestOperations)gets removed with the version 3.0.0, does not support certificate based authentication
-
XsuaaOAuth2TokenService
public XsuaaOAuth2TokenService(@Nonnull org.springframework.web.client.RestOperations restOperations)
-
XsuaaOAuth2TokenService
public XsuaaOAuth2TokenService(@Nonnull org.springframework.web.client.RestOperations restOperations, @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.
-
-