Package com.nimbusds.oauth2.sdk
Class AuthorizationGrant
java.lang.Object
com.nimbusds.oauth2.sdk.AuthorizationGrant
- Direct Known Subclasses:
AssertionGrant
,AuthorizationCodeGrant
,CIBAGrant
,ClientCredentialsGrant
,DeviceCodeGrant
,RefreshTokenGrant
,ResourceOwnerPasswordCredentialsGrant
,TokenExchangeGrant
Authorisation grant. Extending classes should be immutable.
Supported authorisation grant types:
Authorisation code
Resource owner password credentials
Client credentials
Refresh token
GrantType.JWT_BEARER
GrantType.SAML2_BEARER
GrantType.DEVICE_CODE
GrantType.CIBA
GrantType.TOKEN_EXCHANGE
Related specifications:
- OAuth 2.0 (RFC 6749), sections 1.3.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AuthorizationGrant
(GrantType type) Creates a new authorisation grant. -
Method Summary
Modifier and TypeMethodDescriptiongetType()
Gets the authorisation grant type.static AuthorizationGrant
Parses an authorisation grant from the specified request body parameters.Returns the request body parameters for the authorisation grant.
-
Constructor Details
-
AuthorizationGrant
Creates a new authorisation grant.- Parameters:
type
- The authorisation grant type. Must not benull
.
-
-
Method Details
-
getType
Gets the authorisation grant type.- Returns:
- The authorisation grant type.
-
toParameters
Returns the request body parameters for the authorisation grant.- Returns:
- The parameters.
-
parse
Parses an authorisation grant from the specified request body parameters.- Parameters:
params
- The request body parameters. Must not benull
.- Returns:
- The authorisation grant.
- Throws:
ParseException
- If parsing failed or the grant type is not supported.
-