Package com.nimbusds.oauth2.sdk
Class ClientCredentialsGrant
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.AuthorizationGrant
-
- com.nimbusds.oauth2.sdk.ClientCredentialsGrant
-
@Immutable public class ClientCredentialsGrant extends AuthorizationGrant
Client credentials grant. Used in access token requests where the client is acting on its own behalf.Related specifications:
- OAuth 2.0 (RFC 6749), section 4.4.2.
-
-
Field Summary
Fields Modifier and Type Field Description static GrantType
GRANT_TYPE
The grant type.
-
Constructor Summary
Constructors Constructor Description ClientCredentialsGrant()
Creates a new client credentials grant.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClientCredentialsGrant
parse(Map<String,List<String>> params)
Parses a client credentials grant from the specified request body parameters.Map<String,List<String>>
toParameters()
Returns the request body parameters for the authorisation grant.-
Methods inherited from class com.nimbusds.oauth2.sdk.AuthorizationGrant
getType
-
-
-
-
Field Detail
-
GRANT_TYPE
public static final GrantType GRANT_TYPE
The grant type.
-
-
Constructor Detail
-
ClientCredentialsGrant
public ClientCredentialsGrant()
Creates a new client credentials grant. The actual client credentials are included in theclient authentication
of theTokenRequest
.
-
-
Method Detail
-
toParameters
public Map<String,List<String>> toParameters()
Description copied from class:AuthorizationGrant
Returns the request body parameters for the authorisation grant.- Specified by:
toParameters
in classAuthorizationGrant
- Returns:
- The parameters.
-
parse
public static ClientCredentialsGrant parse(Map<String,List<String>> params) throws ParseException
Parses a client credentials grant from the specified request body parameters.Example:
grant_type=client_credentials
- Parameters:
params
- The parameters.- Returns:
- The client credentials grant.
- Throws:
ParseException
- If parsing failed.
-
-