Interface TokenExchangeGrantHandler
- All Superinterfaces:
GrantHandler,Lifecycle
Service Provider Interface (SPI) for handling token exchange grants. Returns
a
token exchange authorisation on
success. Must throw a GeneralException with an
invalid_grant
error code if the subject_token or the optional actor_token
are invalid.
Implementations must be thread-safe.
Related specifications:
- OAuth 2.0 Token Exchange (RFC 8693).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.nimbusds.oauth2.sdk.GrantTypeThe handled grant type. -
Method Summary
Modifier and TypeMethodDescriptiondefault com.nimbusds.oauth2.sdk.GrantTypeReturns the handled grant type.default TokenExchangeAuthorizationprocessGrant(com.nimbusds.oauth2.sdk.tokenexchange.TokenExchangeGrant grant, TokenRequestParameters tokenRequestParams, com.nimbusds.oauth2.sdk.id.ClientID clientID, boolean confidentialClient, com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata clientMetadata, TokenIntrospection tokenIntrospection, TokenIssueHelpers tokenIssueHelpers, GrantHandlerContext handlerCtx) Handles a token exchange request from a client registered with the Connect2id server.default TokenExchangeAuthorizationprocessGrant(com.nimbusds.oauth2.sdk.tokenexchange.TokenExchangeGrant grant, TokenRequestParameters tokenRequestParams, com.nimbusds.oauth2.sdk.id.ClientID clientID, boolean confidentialClient, com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata clientMetadata, TokenIntrospection tokenIntrospection, TokenIssueHelpers tokenIssueHelpers, InvocationContext invocationCtx) Deprecated.
-
Field Details
-
GRANT_TYPE
The handled grant type.
-
-
Method Details
-
getGrantType
Description copied from interface:GrantHandlerReturns the handled grant type.- Specified by:
getGrantTypein interfaceGrantHandler- Returns:
- The grant type;
-
processGrant
@Deprecated default TokenExchangeAuthorization processGrant(com.nimbusds.oauth2.sdk.tokenexchange.TokenExchangeGrant grant, TokenRequestParameters tokenRequestParams, com.nimbusds.oauth2.sdk.id.ClientID clientID, boolean confidentialClient, com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata clientMetadata, TokenIntrospection tokenIntrospection, TokenIssueHelpers tokenIssueHelpers, InvocationContext invocationCtx) throws com.nimbusds.oauth2.sdk.GeneralException Deprecated.Handles a token exchange request from a client registered with the Connect2id server.- Parameters:
grant- The token exchange grant. Notnull.tokenRequestParams- The token request parameters, such as the requested scope. Notnull.clientID- The client identifier. Notnull.confidentialClient-trueif the client is confidential and has been authenticated, elsefalse.clientMetadata- The OAuth 2.0 client / OpenID relying party metadata. Notnull.tokenIntrospection- Token introspection interface for locally issued subject tokens. Notnull.tokenIssueHelpers- Token issue helpers. Notnull.invocationCtx- The invocation context. Notnull.- Returns:
- The authorisation.
- Throws:
com.nimbusds.oauth2.sdk.GeneralException- If the grant is invalid, or another exception was encountered.
-
processGrant
default TokenExchangeAuthorization processGrant(com.nimbusds.oauth2.sdk.tokenexchange.TokenExchangeGrant grant, TokenRequestParameters tokenRequestParams, com.nimbusds.oauth2.sdk.id.ClientID clientID, boolean confidentialClient, com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata clientMetadata, TokenIntrospection tokenIntrospection, TokenIssueHelpers tokenIssueHelpers, GrantHandlerContext handlerCtx) throws com.nimbusds.oauth2.sdk.GeneralException Handles a token exchange request from a client registered with the Connect2id server.- Parameters:
grant- The token exchange grant. Notnull.tokenRequestParams- The token request parameters, such as the requested scope. Notnull.clientID- The client identifier. Notnull.confidentialClient-trueif the client is confidential and has been authenticated, elsefalse.clientMetadata- The OAuth 2.0 client / OpenID relying party metadata. Notnull.tokenIntrospection- Token introspection interface for locally issued subject tokens. Notnull.tokenIssueHelpers- Token issue helpers. Notnull.handlerCtx- The handler context. Notnull.- Returns:
- The authorisation.
- Throws:
com.nimbusds.oauth2.sdk.GeneralException- If the grant is invalid, or another exception was encountered.
-