Package com.nimbusds.oauth2.sdk.device
Class DeviceCodeGrant
java.lang.Object
com.nimbusds.oauth2.sdk.AuthorizationGrant
com.nimbusds.oauth2.sdk.device.DeviceCodeGrant
Device code grant for the OAuth 2.0 Device Authorization Grant.
Related specifications:
- OAuth 2.0 Device Authorization Grant (RFC 8628)
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the device code received from the authorisation server.int
hashCode()
static DeviceCodeGrant
Parses a device code grant from the specified request body parameters.Returns the request body parameters for the authorisation grant.Methods inherited from class com.nimbusds.oauth2.sdk.AuthorizationGrant
getType
-
Field Details
-
GRANT_TYPE
The grant type.
-
-
Constructor Details
-
DeviceCodeGrant
Creates a new device code grant.- Parameters:
deviceCode
- The device code. Must not benull
.
-
-
Method Details
-
getDeviceCode
Returns the device code received from the authorisation server.- Returns:
- The device code received from the authorisation server.
-
toParameters
Description copied from class:AuthorizationGrant
Returns the request body parameters for the authorisation grant.- Specified by:
toParameters
in classAuthorizationGrant
- Returns:
- The parameters.
-
parse
Parses a device code grant from the specified request body parameters.Example:
grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code &device_code=GmRhmhcxhwAzkoEqiMEg_DnyEysNkuNhszIySk9eS
- Parameters:
params
- The parameters.- Returns:
- The device code grant.
- Throws:
ParseException
- If parsing failed.
-
equals
-
hashCode
-