Package com.nimbusds.oauth2.sdk
Class AuthorizationGrant
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.AuthorizationGrant
-
- Direct Known Subclasses:
AssertionGrant,AuthorizationCodeGrant,ClientCredentialsGrant,DeviceCodeGrant,RefreshTokenGrant,ResourceOwnerPasswordCredentialsGrant
public abstract class AuthorizationGrant extends Object
Authorisation grant. Extending classes should be immutable.Supported authorisation grant types:
Authorisation codeResource owner password credentialsClient credentialsRefresh tokenGrantType.JWT_BEARERGrantType.SAML2_BEARERGrantType.DEVICE_CODE
Related specifications:
- OAuth 2.0 (RFC 6749), sections 1.3.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAuthorizationGrant(GrantType type)Creates a new authorisation grant.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description GrantTypegetType()Gets the authorisation grant type.static AuthorizationGrantparse(Map<String,List<String>> params)Parses an authorisation grant from the specified request body parameters.abstract Map<String,List<String>>toParameters()Returns the request body parameters for the authorisation grant.
-
-
-
Constructor Detail
-
AuthorizationGrant
protected AuthorizationGrant(GrantType type)
Creates a new authorisation grant.- Parameters:
type- The authorisation grant type. Must not benull.
-
-
Method Detail
-
getType
public GrantType getType()
Gets the authorisation grant type.- Returns:
- The authorisation grant type.
-
toParameters
public abstract Map<String,List<String>> toParameters()
Returns the request body parameters for the authorisation grant.- Returns:
- The parameters.
-
parse
public static AuthorizationGrant parse(Map<String,List<String>> params) throws ParseException
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.
-
-