Package com.nimbusds.oauth2.sdk.device
Class DeviceCode
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.id.Identifier
-
- com.nimbusds.oauth2.sdk.device.DeviceCode
-
- All Implemented Interfaces:
Serializable
,Comparable<Identifier>
,net.minidev.json.JSONAware
@Immutable public final class DeviceCode extends Identifier
Device code.Related specifications:
- OAuth 2.0 Device Authorization Grant (RFC 8628).
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.nimbusds.oauth2.sdk.id.Identifier
DEFAULT_BYTE_LENGTH, secureRandom
-
-
Constructor Summary
Constructors Constructor Description DeviceCode()
Creates a new device code with a randomly generated 256-bit (32-byte) value, Base64URL-encoded.DeviceCode(int byteLength)
Creates a new device code with a randomly generated value of the specified byte length, Base64URL-encoded.DeviceCode(String value)
Creates a new device code with the specified value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
-
Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier
compareTo, getValue, hashCode, toJSONString, toString, toStringList
-
-
-
-
Constructor Detail
-
DeviceCode
public DeviceCode(String value)
Creates a new device code with the specified value.- Parameters:
value
- The code value. Must not benull
or empty string.
-
DeviceCode
public DeviceCode(int byteLength)
Creates a new device code with a randomly generated value of the specified byte length, Base64URL-encoded.- Parameters:
byteLength
- The byte length of the value to generate. Must be greater than one.
-
DeviceCode
public DeviceCode()
Creates a new device code with a randomly generated 256-bit (32-byte) value, Base64URL-encoded.
-
-
Method Detail
-
equals
public boolean equals(Object object)
- Overrides:
equals
in classIdentifier
-
-