Class DeviceAuthorizationResponse

java.lang.Object
com.nimbusds.oauth2.sdk.device.DeviceAuthorizationResponse
All Implemented Interfaces:
Message, Response
Direct Known Subclasses:
DeviceAuthorizationErrorResponse, DeviceAuthorizationSuccessResponse

public abstract class DeviceAuthorizationResponse extends Object implements Response
Token endpoint response. This is the base abstract class for device authorization success and error responses.

Related specifications:

  • OAuth 2.0 Device Authorization Grant (RFC 8628)
  • Constructor Details

  • Method Details

    • toSuccessResponse

      Casts this response to an authorization success response.
      Returns:
      The authorization success response.
    • toErrorResponse

      Casts this response to a device authorization error response.
      Returns:
      The device authorization error response.
    • parse

      public static DeviceAuthorizationResponse parse(net.minidev.json.JSONObject jsonObject) throws ParseException
      Parses a device authorization response from the specified JSON object.
      Parameters:
      jsonObject - The JSON object to parse. Must not be null.
      Returns:
      The device authorization success or error response.
      Throws:
      ParseException - If the JSON object couldn't be parsed to a device authorization response.
    • parse

      public static DeviceAuthorizationResponse parse(HTTPResponse httpResponse) throws ParseException
      Parses a device authorization response from the specified HTTP response.
      Parameters:
      httpResponse - The HTTP response. Must not be null.
      Returns:
      The device authorization success or error response.
      Throws:
      ParseException - If the HTTP response couldn't be parsed to a device authorization response.