Package com.nimbusds.oauth2.sdk.device
Class DeviceAuthorizationResponse
java.lang.Object
com.nimbusds.oauth2.sdk.device.DeviceAuthorizationResponse
- Direct Known Subclasses:
DeviceAuthorizationErrorResponse
,DeviceAuthorizationSuccessResponse
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.Casts this response to a device authorization error response.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 Details
-
DeviceAuthorizationResponse
public DeviceAuthorizationResponse()
-
-
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 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
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.
-