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 |
retrieveAccessTokenHeaderViaUserTokenExchange(URI xsuaaUri,
ClientCredentials credentials)
Retrieves a
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) with Refresh Token based authentication and returns the token 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. |
AccessToken |
retrieveAccessTokenViaClientCredentialsGrant(URI xsuaaUri,
ClientCredentials credentials)
Retrieves an
AccessToken for a given pair of client credentials. |
AccessToken |
retrieveAccessTokenViaUserTokenExchange(URI xsuaaUri,
ClientCredentials credentials)
Retrieves an
AccessToken through User Token Exchange for the currently active user token and the given
pair of client credentials. |
AccessToken |
retrieveAccessTokenViaUserTokenGrant(URI xsuaaUri,
ClientCredentials credentials)
Retrieves an
AccessToken for the currently active user token and the client id. |
public XsuaaService()
XsuaaService
instance, caching up to 100.000 responses for 60 minutes.@Nonnull public Header retrieveAccessTokenHeaderViaClientCredentialsGrant(@Nonnull URI xsuaaUri, @Nonnull ClientCredentials credentials)
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.retrieveAccessTokenViaClientCredentialsGrant(java.net.URI, com.sap.cloud.sdk.cloudplatform.security.ClientCredentials)
@Nonnull public Header retrieveAccessTokenHeaderViaUserTokenGrant(@Nonnull URI xsuaaUri, @Nonnull ClientCredentials credentials)
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.retrieveAccessTokenViaUserTokenGrant(java.net.URI, com.sap.cloud.sdk.cloudplatform.security.ClientCredentials)
,
retrieveAccessTokenViaUserTokenExchange(java.net.URI, com.sap.cloud.sdk.cloudplatform.security.ClientCredentials)
@Nonnull public Header retrieveAccessTokenHeaderViaUserTokenExchange(@Nonnull URI xsuaaUri, @Nonnull ClientCredentials credentials)
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) with Refresh Token based authentication and returns the token 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.retrieveAccessTokenViaUserTokenExchange(java.net.URI, com.sap.cloud.sdk.cloudplatform.security.ClientCredentials)
@Nonnull public AccessToken retrieveAccessTokenViaClientCredentialsGrant(@Nonnull URI xsuaaUri, @Nonnull ClientCredentials credentials)
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 AccessToken retrieveAccessTokenViaUserTokenGrant(@Nonnull URI xsuaaUri, @Nonnull ClientCredentials credentials)
AccessToken
for the currently active user token and the client id.xsuaaUri
- The xsuaa service URI to retrieve the token from.credentials
- The client id is part of the credentials.AccessToken
for the active user token 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 AccessToken retrieveAccessTokenViaUserTokenExchange(@Nonnull URI xsuaaUri, @Nonnull ClientCredentials credentials)
AccessToken
through User Token Exchange for the currently active user token and the 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 active user token 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.