Interface ClientCredentialsGrantHandler
- All Superinterfaces:
GrantHandler,Lifecycle
Service Provider Interface (SPI) for handling OAuth 2.0 client credentials
grants. Returns the matching
authorisation on
success.
Implementations must be thread-safe.
Related specifications:
- OAuth 2.0 (RFC 6749), sections 1.3.4 and 4.4.
-
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 GrantAuthorizationprocessGrant(@Nullable com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.oauth2.sdk.id.ClientID clientID, com.nimbusds.oauth2.sdk.client.ClientMetadata clientMetadata) Deprecated.default GrantAuthorizationprocessGrant(TokenRequestParameters tokenRequestParams, com.nimbusds.oauth2.sdk.id.ClientID clientID, com.nimbusds.oauth2.sdk.client.ClientMetadata clientMetadata, GrantHandlerContext handlerCtx) Handles a client credentials grant.default GrantAuthorizationprocessGrant(TokenRequestParameters tokenRequestParams, com.nimbusds.oauth2.sdk.id.ClientID clientID, com.nimbusds.oauth2.sdk.client.ClientMetadata clientMetadata, 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 GrantAuthorization processGrant(@Nullable com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.oauth2.sdk.id.ClientID clientID, com.nimbusds.oauth2.sdk.client.ClientMetadata clientMetadata) throws com.nimbusds.oauth2.sdk.GeneralException Deprecated.Handles a client credentials grant. The client is confidential and always authenticated.- Parameters:
scope- The requested scope,nullif not specified.clientID- The client identifier. Notnull.clientMetadata- The OAuth 2.0 client metadata. Notnull.If the requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner the handler must throw a
GeneralExceptionwith aninvalid_scopeerror code.- Returns:
- The authorisation.
- Throws:
com.nimbusds.oauth2.sdk.GeneralException- If the grant is invalid, or another exception was encountered.
-
processGrant
@Deprecated default GrantAuthorization processGrant(TokenRequestParameters tokenRequestParams, com.nimbusds.oauth2.sdk.id.ClientID clientID, com.nimbusds.oauth2.sdk.client.ClientMetadata clientMetadata, InvocationContext invocationCtx) throws com.nimbusds.oauth2.sdk.GeneralException Deprecated.Handles a client credentials grant. The client is confidential and always authenticated.- Parameters:
tokenRequestParams- The token request parameters, such as the requested scope. Notnull.clientID- The client identifier. Notnull.clientMetadata- The OAuth 2.0 client metadata. Notnull.invocationCtx- The invocation context. Notnull.If the requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner the handler must throw a
GeneralExceptionwith aninvalid_scopeerror code.- Returns:
- The authorisation.
- Throws:
com.nimbusds.oauth2.sdk.GeneralException- If the grant is invalid, or another exception was encountered.
-
processGrant
default GrantAuthorization processGrant(TokenRequestParameters tokenRequestParams, com.nimbusds.oauth2.sdk.id.ClientID clientID, com.nimbusds.oauth2.sdk.client.ClientMetadata clientMetadata, GrantHandlerContext handlerCtx) throws com.nimbusds.oauth2.sdk.GeneralException Handles a client credentials grant. The client is confidential and always authenticated.- Parameters:
tokenRequestParams- The token request parameters, such as the requested scope. Notnull.clientID- The client identifier. Notnull.clientMetadata- The OAuth 2.0 client metadata. Notnull.handlerCtx- The handler context. Notnull.If the requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner the handler must throw a
GeneralExceptionwith aninvalid_scopeerror code.- Returns:
- The authorisation.
- Throws:
com.nimbusds.oauth2.sdk.GeneralException- If the grant is invalid, or another exception was encountered.
-