Package com.nimbusds.oauth2.sdk.device
Class DeviceAuthorizationResponse
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.device.DeviceAuthorizationResponse
-
- 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 Summary
Constructors Constructor Description DeviceAuthorizationResponse()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DeviceAuthorizationResponse
parse(HTTPResponse httpResponse)
Parses a device authorization response from the specified HTTP response.static DeviceAuthorizationResponse
parse(net.minidev.json.JSONObject jsonObject)
Parses a device authorization response from the specified JSON object.DeviceAuthorizationErrorResponse
toErrorResponse()
Casts this response to a device authorization error response.DeviceAuthorizationSuccessResponse
toSuccessResponse()
Casts this response to an authorization success response.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.nimbusds.oauth2.sdk.Response
indicatesSuccess, toHTTPResponse
-
-
-
-
Constructor Detail
-
DeviceAuthorizationResponse
public DeviceAuthorizationResponse()
-
-
Method Detail
-
toSuccessResponse
public DeviceAuthorizationSuccessResponse toSuccessResponse()
Casts this response to an authorization success response.- Returns:
- The authorization success response.
-
toErrorResponse
public DeviceAuthorizationErrorResponse 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 benull
.- 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 benull
.- Returns:
- The device authorization success or error response.
- Throws:
ParseException
- If the HTTP response couldn't be parsed to a device authorization response.
-
-