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 TypeMethodDescriptionbooleanReturns 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.inthashCode()static TokenExchangeGrantParses 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,nullif not specified.actorTokenType- Identifier for the type of the actor token, if present.requestedTokenType- Optional identifier for the requested type of security token,nullif not specified.audience- Optional audience for the requested security token,nullif 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,
nullif not specified.
-
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,
nullif not specified.
-
getActorTokenType
Returns the identifier for the type of the optional actor token, if present.- Returns:
- The actor token type identifier,
nullif not present.
-
getRequestedTokenType
Returns the optional identifier for the requested type of security token.- Returns:
- The requested token type,
nullif not specified.
-
getAudience
Returns the optional audience for the requested security token.- Returns:
- The audience,
nullif not specified.
-
toParameters
Description copied from class:AuthorizationGrantReturns the request body parameters for the authorisation grant.- Specified by:
toParametersin 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
-