public class XsuaaService extends Object
Constructor and Description |
---|
XsuaaService()
Creates a new
XsuaaService instance, caching up to 100.000 responses for 60 minutes. |
Modifier and Type | Method and Description |
---|---|
Header |
retrieveAccessTokenHeaderViaClientCredentialsGrant(URI xsuaaUri,
ClientCredentials credentials)
Retrieves an
AccessToken for a given pair of client credentials and returns it as part of an
Authorization header. |
Header |
retrieveAccessTokenHeaderViaUserTokenGrant(URI xsuaaUri,
ClientCredentials credentials)
Retrieves an
AccessToken for a given pair of client credentials in the name of an authenticated user (to
be found in the JWT of the current request) and returns it as part of an Authorization header. |
com.sap.cloud.sdk.cloudplatform.connectivity.AccessToken |
retrieveAccessTokenViaClientCredentialsGrant(URI xsuaaUri,
ClientCredentials credentials)
Retrieves an
AccessToken for a given pair of client credentials. |
com.sap.cloud.sdk.cloudplatform.connectivity.AccessToken |
retrieveAccessTokenViaUserTokenGrant(URI xsuaaUri,
ClientCredentials credentials)
Retrieves an
AccessToken for a given pair of client credentials in the name of an authenticated user (to
be found in the JWT of the current request). |
public XsuaaService()
XsuaaService
instance, caching up to 100.000 responses for 60 minutes.@Nonnull public Header retrieveAccessTokenHeaderViaClientCredentialsGrant(@Nonnull URI xsuaaUri, @Nonnull ClientCredentials credentials) throws TokenRequestFailedException, TokenRequestDeniedException
AccessToken
for a given pair of client credentials and returns it as part of an
Authorization header.xsuaaUri
- The xsuaa service URI to retrieve the token from.credentials
- The client credentials to retrieve the token for.HttpHeaders.AUTHORIZATION
header with the retrieved access token.TokenRequestFailedException
- When the token cannot be requested or correctly parsed.TokenRequestDeniedException
- When the authorization for the token request was rejected.@Nonnull public com.sap.cloud.sdk.cloudplatform.connectivity.AccessToken retrieveAccessTokenViaClientCredentialsGrant(@Nonnull URI xsuaaUri, @Nonnull ClientCredentials credentials) throws TokenRequestFailedException, TokenRequestDeniedException
AccessToken
for a given pair of client credentials.xsuaaUri
- The xsuaa service URI to retrieve the token from.credentials
- The client credentials to retrieve the token for.AccessToken
for the given client credentials received from the given xsuaa service.TokenRequestFailedException
- When the token cannot be requested or correctly parsed.TokenRequestDeniedException
- When the authorization for the token request was rejected.@Nonnull public Header retrieveAccessTokenHeaderViaUserTokenGrant(@Nonnull URI xsuaaUri, @Nonnull ClientCredentials credentials) throws TokenRequestFailedException, TokenRequestDeniedException
AccessToken
for a given pair of client credentials in the name of an authenticated user (to
be found in the JWT of the current request) and returns it as part of an Authorization header.xsuaaUri
- The xsuaa service URI to retrieve the token from.credentials
- The client credentials to retrieve the token for.HttpHeaders.AUTHORIZATION
header with the retrieved access token.TokenRequestFailedException
- When the token cannot be requested or correctly parsed.TokenRequestDeniedException
- When the authorization for the token request was rejected.@Nonnull public com.sap.cloud.sdk.cloudplatform.connectivity.AccessToken retrieveAccessTokenViaUserTokenGrant(@Nonnull URI xsuaaUri, @Nonnull ClientCredentials credentials) throws TokenRequestFailedException, TokenRequestDeniedException
AccessToken
for a given pair of client credentials in the name of an authenticated user (to
be found in the JWT of the current request).xsuaaUri
- The xsuaa service URI to retrieve the token from.credentials
- The client credentials to retrieve the token for.AccessToken
for the given client credentials received from the given xsuaa service.TokenRequestFailedException
- When the token cannot be requested or correctly parsed.TokenRequestDeniedException
- When the authorization for the token request was rejected.Copyright © 2020 SAP SE. All rights reserved.