Class TokenExchangeGrant
java.lang.Object
com.nimbusds.oauth2.sdk.AuthorizationGrant
com.nimbusds.oauth2.sdk.tokenexchange.TokenExchangeGrant
OAuth 2.0 token exchange grant.
Related specifications:
- OAuth 2.0 Token Exchange (RFC 8693)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTokenExchangeGrant
(Token subjectToken, TokenTypeURI subjectTokenType) Creates a new token exchange grant.TokenExchangeGrant
(Token subjectToken, TokenTypeURI subjectTokenType, Token actorToken, TokenTypeURI actorTokenType, TokenTypeURI requestedTokenType, List<Audience> audience) Creates a new token exchange grant. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the optional token representing the identity of the acting party.Returns the identifier for the type of the optional actor token, if present.Returns the optional audience for the requested security token.Returns the optional identifier for the requested type of security token.Returns the subject token representing the identity of the party on behalf of whom the request is being made.Returns the identifier for the type of the subject token.int
hashCode()
static TokenExchangeGrant
Parses a token exchange grant from the specified request body parameters.Returns the request body parameters for the authorisation grant.Methods inherited from class com.nimbusds.oauth2.sdk.AuthorizationGrant
getType
-
Field Details
-
GRANT_TYPE
The grant type.
-
-
Constructor Details
-
TokenExchangeGrant
Creates a new token exchange grant.- Parameters:
subjectToken
- The subject token representing the identity of the party on behalf of whom the request is being made. Must not benull
.subjectTokenType
- Identifier for the type of the subject token. Must not benull
.
-
TokenExchangeGrant
public TokenExchangeGrant(Token subjectToken, TokenTypeURI subjectTokenType, Token actorToken, TokenTypeURI actorTokenType, TokenTypeURI requestedTokenType, List<Audience> audience) Creates a new token exchange grant.- Parameters:
subjectToken
- The subject token representing the identity of the party on behalf of whom the request is being made. Must not benull
.subjectTokenType
- Identifier for the type of the subject token. Must not benull
.actorToken
- Optional token representing the identity of the acting party,null
if not specified.actorTokenType
- Identifier for the type of the actor token, if present.requestedTokenType
- Optional identifier for the requested type of security token,null
if not specified.audience
- Optional audience for the requested security token,null
if not specified.
-
-
Method Details
-
getSubjectToken
Returns the subject token representing the identity of the party on behalf of whom the request is being made.- Returns:
- The subject token.
-
getSubjectTokenType
Returns the identifier for the type of the subject token.- Returns:
- The subject token type identifier.
-
getActorToken
Returns the optional token representing the identity of the acting party.- Returns:
- The actor token,
null
if not specified.
-
getActorTokenType
Returns the identifier for the type of the optional actor token, if present.- Returns:
- The actor token type identifier,
null
if not present.
-
getRequestedTokenType
Returns the optional identifier for the requested type of security token.- Returns:
- The requested token type,
null
if not specified.
-
getAudience
Returns the optional audience for the requested security token.- Returns:
- The audience,
null
if not specified.
-
toParameters
Description copied from class:AuthorizationGrant
Returns the request body parameters for the authorisation grant.- Specified by:
toParameters
in classAuthorizationGrant
- Returns:
- The parameters.
-
parse
Parses a token exchange grant from the specified request body parameters.Example:
grant_type=urn:ietf:params:oauth:grant-type:token-exchange resource=https://backend.example.com/api subject_token=accVkjcJyb4BWCxGsndESCJQbdFMogUC5PbRDqceLTC subject_token_type=urn:ietf:params:oauth:token-type:access_token
- Parameters:
params
- The parameters.- Returns:
- The token exchange grant.
- Throws:
ParseException
- If parsing failed.
-
equals
-
hashCode
-