ErrorResponse
, Message
, Response
@Immutable public class DeviceAuthorizationErrorResponse extends DeviceAuthorizationResponse implements ErrorResponse
Standard authorization errors:
Example HTTP response:
HTTP/1.1 400 Bad Request Content-Type: application/json Cache-Control: no-store Pragma: no-cache { "error" : "invalid_request" }
Related specifications:
Modifier | Constructor | Description |
---|---|---|
protected |
DeviceAuthorizationErrorResponse() |
Creates a new OAuth 2.0 device authorization error response.
|
|
DeviceAuthorizationErrorResponse(ErrorObject error) |
Creates a new OAuth 2.0 device authorization error response.
|
Modifier and Type | Method | Description |
---|---|---|
ErrorObject |
getErrorObject() |
Gets the error associated with the error response.
|
static Set<ErrorObject> |
getStandardErrors() |
Gets the standard OAuth 2.0 errors for a device authorization error
response.
|
boolean |
indicatesSuccess() |
Checks if the response indicates success.
|
static DeviceAuthorizationErrorResponse |
parse(HTTPResponse httpResponse) |
Parses an OAuth 2.0 device authorization error response from the
specified HTTP response.
|
static DeviceAuthorizationErrorResponse |
parse(net.minidev.json.JSONObject jsonObject) |
Parses an OAuth 2.0 device authorization response from the specified
JSON object.
|
HTTPResponse |
toHTTPResponse() |
Returns the matching HTTP response.
|
net.minidev.json.JSONObject |
toJSONObject() |
Returns the JSON object for this token error response.
|
toErrorResponse, toSuccessResponse
protected DeviceAuthorizationErrorResponse()
public DeviceAuthorizationErrorResponse(ErrorObject error)
error
- The error. Should match one of the
standard errors
for a token
error response. Must not be null
.public static Set<ErrorObject> getStandardErrors()
public boolean indicatesSuccess()
Response
indicatesSuccess
in interface Response
true
if the response indicates success, else
false
.public ErrorObject getErrorObject()
ErrorResponse
getErrorObject
in interface ErrorResponse
null
if none.public net.minidev.json.JSONObject toJSONObject()
public HTTPResponse toHTTPResponse()
Response
toHTTPResponse
in interface Response
public static DeviceAuthorizationErrorResponse parse(net.minidev.json.JSONObject jsonObject) throws ParseException
jsonObject
- The JSON object to parse. Its status code must not
be 200 (OK). Must not be null
.ParseException
- If the JSON object couldn't be parsed to an
OAuth 2.0 device authorization error
response.public static DeviceAuthorizationErrorResponse parse(HTTPResponse httpResponse) throws ParseException
httpResponse
- The HTTP response to parse. Its status code must
not be 200 (OK). Must not be null
.ParseException
- If the HTTP response couldn't be parsed to an
OAuth 2.0 device authorization error
response.Copyright © 2019 Connect2id Ltd.. All rights reserved.