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:
  • Constructor Details

    • DeviceCode

      public DeviceCode(String value)
      Creates a new device code with the specified value.
      Parameters:
      value - The code value. Must not be null 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 Details