Interface OAuth2TokenService
-
- All Known Implementing Classes:
AbstractOAuth2TokenService,DefaultOAuth2TokenService,XsuaaOAuth2TokenService
public interface OAuth2TokenServiceRetrieves OAuth2 Access Tokens as documented here: https://docs.cloudfoundry.org/api/uaa/version/4.31.0/index.html#token
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description OAuth2TokenResponseretrieveAccessTokenViaClientCredentialsGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String zoneId, String subdomain, Map<String,String> optionalParameters, boolean disableCacheForRequest)Requests access token from OAuth Server with client credentials.default OAuth2TokenResponseretrieveAccessTokenViaClientCredentialsGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String subdomain, Map<String,String> optionalParameters)Deprecated.gets removed in favor ofretrieveAccessTokenViaClientCredentialsGrant(URI, ClientIdentity, String, Map, boolean)with next major version 3.0.0default OAuth2TokenResponseretrieveAccessTokenViaClientCredentialsGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String subdomain, Map<String,String> optionalParameters, boolean disableCacheForRequest)Deprecated.gets removed in favor ofretrieveAccessTokenViaClientCredentialsGrant(URI, ClientIdentity, String, String, Map, boolean)with next major version 3.0.0default OAuth2TokenResponseretrieveAccessTokenViaJwtBearerTokenGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String token, String subdomain, Map<String,String> optionalParameters)Deprecated.gets removed in favor ofretrieveAccessTokenViaJwtBearerTokenGrant(URI, ClientIdentity, String, String, Map, boolean)with next major version 3.0.0OAuth2TokenResponseretrieveAccessTokenViaJwtBearerTokenGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String token, String subdomain, Map<String,String> optionalParameters, boolean disableCacheForRequest)OAuth2TokenResponseretrieveAccessTokenViaJwtBearerTokenGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String token, Map<String,String> optionalParameters, boolean disableCache, String xZid)default OAuth2TokenResponseretrieveAccessTokenViaPasswordGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String username, String password, String subdomain, Map<String,String> optionalParameters)Deprecated.gets removed in favor ofretrieveAccessTokenViaPasswordGrant(URI, ClientIdentity, String, String, String, Map, boolean)with next major version 3.0.0OAuth2TokenResponseretrieveAccessTokenViaPasswordGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String username, String password, String subdomain, Map<String,String> optionalParameters, boolean disableCacheForRequest)Requests access token from OAuth Server with user / password.default OAuth2TokenResponseretrieveAccessTokenViaRefreshToken(URI tokenEndpointUri, ClientIdentity clientIdentity, String refreshToken, String subdomain)Deprecated.gets removed in favor ofretrieveAccessTokenViaRefreshToken(URI, ClientIdentity, String, String, boolean)with next major version 3.0.0OAuth2TokenResponseretrieveAccessTokenViaRefreshToken(URI tokenEndpointUri, ClientIdentity clientIdentity, String refreshToken, String subdomain, boolean disableCacheForRequest)Requests access token from OAuth Server with refresh-token.OAuth2TokenResponseretrieveAccessTokenViaUserTokenGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String token, String subdomain, Map<String,String> optionalParameters)Deprecated.instead use jwt bearer {retrieveAccessTokenViaJwtBearerTokenGrant(URI, ClientIdentity, String, String, Map)}.
-
-
-
Method Detail
-
retrieveAccessTokenViaClientCredentialsGrant
@Deprecated default OAuth2TokenResponse retrieveAccessTokenViaClientCredentialsGrant(@Nonnull URI tokenEndpointUri, @Nonnull ClientIdentity clientIdentity, @Nullable String subdomain, @Nullable Map<String,String> optionalParameters, boolean disableCacheForRequest) throws OAuth2ServiceException
Deprecated.gets removed in favor ofretrieveAccessTokenViaClientCredentialsGrant(URI, ClientIdentity, String, String, Map, boolean)with next major version 3.0.0Requests access token from OAuth Server with client credentials.- Parameters:
tokenEndpointUri- the token endpoint URI.clientIdentity- the client identity of the OAuth client, the recipient of the token.subdomain- optionally indicates what Identity Zone this request goes to by supplying a subdomain (tenant).optionalParameters- optional request parameters, can be null.disableCacheForRequest- set to true disables the token cache for this request.- Returns:
- the OAuth2AccessToken.
- Throws:
OAuth2ServiceException- in case of an error during the http request.
-
retrieveAccessTokenViaClientCredentialsGrant
OAuth2TokenResponse retrieveAccessTokenViaClientCredentialsGrant(@Nonnull URI tokenEndpointUri, @Nonnull ClientIdentity clientIdentity, @Nullable String zoneId, @Nullable String subdomain, @Nullable Map<String,String> optionalParameters, boolean disableCacheForRequest) throws OAuth2ServiceException
Requests access token from OAuth Server with client credentials.- Parameters:
tokenEndpointUri- the token endpoint URI.clientIdentity- the client identity of the OAuth client, the recipient of the token.zoneId- Zone identifier - tenant discriminatorsubdomain- optionally indicates what Identity Zone this request goes to by supplying a subdomain (tenant).optionalParameters- optional request parameters, can be null.disableCacheForRequest- set to true disables the token cache for this request.- Returns:
- the OAuth2AccessToken.
- Throws:
OAuth2ServiceException- in case of an error during the http request.
-
retrieveAccessTokenViaClientCredentialsGrant
@Deprecated default OAuth2TokenResponse retrieveAccessTokenViaClientCredentialsGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, @Nullable String subdomain, @Nullable Map<String,String> optionalParameters) throws OAuth2ServiceException
Deprecated.gets removed in favor ofretrieveAccessTokenViaClientCredentialsGrant(URI, ClientIdentity, String, Map, boolean)with next major version 3.0.0Same asretrieveAccessTokenViaClientCredentialsGrant(URI, ClientIdentity, String, Map, boolean)except that disableCacheForRequest is set tofalse.- Throws:
OAuth2ServiceException
-
retrieveAccessTokenViaUserTokenGrant
@Deprecated OAuth2TokenResponse retrieveAccessTokenViaUserTokenGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String token, @Nullable String subdomain, @Nullable Map<String,String> optionalParameters) throws OAuth2ServiceException
Deprecated.instead use jwt bearer {retrieveAccessTokenViaJwtBearerTokenGrant(URI, ClientIdentity, String, String, Map)}.Exchanges user access token from OAuth Server with user access token. This endpoint returns only opaque access token, so that another call using {link #retrieveAccessTokenViaRefreshToken} is required.- Parameters:
tokenEndpointUri- the token endpoint URI.clientIdentity- the client identity of the OAuth client, the recipient of the token.token- the user bearer token, that represents an authenticated user.subdomain- optionally indicates what Identity Zone this request goes to by supplying a subdomain (tenant).optionalParameters- optional request parameters, can be null.- Returns:
- the OAuth2AccessToken.
- Throws:
OAuth2ServiceException- in case of an error during the http request.
-
retrieveAccessTokenViaRefreshToken
OAuth2TokenResponse retrieveAccessTokenViaRefreshToken(URI tokenEndpointUri, ClientIdentity clientIdentity, String refreshToken, @Nullable String subdomain, boolean disableCacheForRequest) throws OAuth2ServiceException
Requests access token from OAuth Server with refresh-token.- Parameters:
tokenEndpointUri- the token endpoint URI.clientIdentity- the client identity of the OAuth client, the recipient of the token.refreshToken- the refresh token that was returned along with the access token {link #OAuth2AccessToken}.subdomain- optionally indicates what Identity Zone this request goes to by supplying a subdomain (tenant).disableCacheForRequest- set to true disables the token cache for this request.- Returns:
- the OAuth2AccessToken
- Throws:
OAuth2ServiceException- in case of an error during the http request.
-
retrieveAccessTokenViaRefreshToken
@Deprecated default OAuth2TokenResponse retrieveAccessTokenViaRefreshToken(URI tokenEndpointUri, ClientIdentity clientIdentity, String refreshToken, @Nullable String subdomain) throws OAuth2ServiceException
Deprecated.gets removed in favor ofretrieveAccessTokenViaRefreshToken(URI, ClientIdentity, String, String, boolean)with next major version 3.0.0Same asretrieveAccessTokenViaRefreshToken(URI, ClientIdentity, String, String, boolean)except that disableCacheForRequest is set tofalse.- Throws:
OAuth2ServiceException
-
retrieveAccessTokenViaPasswordGrant
OAuth2TokenResponse retrieveAccessTokenViaPasswordGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String username, String password, @Nullable String subdomain, @Nullable Map<String,String> optionalParameters, boolean disableCacheForRequest) throws OAuth2ServiceException
Requests access token from OAuth Server with user / password.- Parameters:
tokenEndpointUri- the token endpoint URI.clientIdentity- the client identity of the OAuth client, the recipient of the token.username- the username for the user trying to get a tokenpassword- the password for the user trying to get a tokensubdomain- optionally indicates what Identity Zone this request goes to by supplying a subdomain (tenant).optionalParameters- optional request parameters, can be null.disableCacheForRequest- set to true disables the token cache for this request.- Returns:
- the OAuth2AccessToken
- Throws:
OAuth2ServiceException- in case of an error during the http request.
-
retrieveAccessTokenViaPasswordGrant
@Deprecated default OAuth2TokenResponse retrieveAccessTokenViaPasswordGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String username, String password, @Nullable String subdomain, @Nullable Map<String,String> optionalParameters) throws OAuth2ServiceException
Deprecated.gets removed in favor ofretrieveAccessTokenViaPasswordGrant(URI, ClientIdentity, String, String, String, Map, boolean)with next major version 3.0.0Same asretrieveAccessTokenViaPasswordGrant(URI, ClientIdentity, String, String, String, Map, boolean)except that disableCacheForRequest is set tofalse.- Throws:
OAuth2ServiceException
-
retrieveAccessTokenViaJwtBearerTokenGrant
OAuth2TokenResponse retrieveAccessTokenViaJwtBearerTokenGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String token, @Nullable String subdomain, @Nullable Map<String,String> optionalParameters, boolean disableCacheForRequest) throws OAuth2ServiceException
- Parameters:
tokenEndpointUri- the token endpoint URI.clientIdentity- the client identity of the OAuth client, the recipient of the token.token- the JWT token identifying representing the user to be authenticatedsubdomain- optionally indicates what Identity Zone this request goes to by supplying a subdomain (tenant).optionalParameters- optional request parameters, can be null.disableCacheForRequest- set to true disables the token cache for this request.- Returns:
- the OAuth2AccessToken
- Throws:
OAuth2ServiceException- in case of an error during the http request.
-
retrieveAccessTokenViaJwtBearerTokenGrant
@Deprecated default OAuth2TokenResponse retrieveAccessTokenViaJwtBearerTokenGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, String token, @Nullable String subdomain, @Nullable Map<String,String> optionalParameters) throws OAuth2ServiceException
Deprecated.gets removed in favor ofretrieveAccessTokenViaJwtBearerTokenGrant(URI, ClientIdentity, String, String, Map, boolean)with next major version 3.0.0Same asretrieveAccessTokenViaJwtBearerTokenGrant(URI, ClientIdentity, String, String, Map, boolean)except that disableCacheForRequest is set tofalse.- Throws:
OAuth2ServiceException
-
retrieveAccessTokenViaJwtBearerTokenGrant
OAuth2TokenResponse retrieveAccessTokenViaJwtBearerTokenGrant(URI tokenEndpointUri, ClientIdentity clientIdentity, @Nonnull String token, @Nullable Map<String,String> optionalParameters, boolean disableCache, @Nonnull String xZid) throws OAuth2ServiceException
- Parameters:
tokenEndpointUri- the token endpoint URI.clientIdentity- the client identity of the OAuth client, the recipient of the token.token- the JWT token identifying representing the user to be authenticatedoptionalParameters- optional request parameters, can be null.disableCache- setting to true disables the token cache for this request.xZid- zone id of the tenant- Returns:
- the OAuth2AccessToken
- Throws:
OAuth2ServiceException- in case of an error during the http request.
-
-