|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nimbusds.oauth2.sdk.TokenResponse com.nimbusds.oauth2.sdk.TokenErrorResponse
@Immutable public class TokenErrorResponse
OAuth 2.0 Token error response. This class is immutable.
Standard token errors:
OAuth2Error.INVALID_REQUEST
OAuth2Error.INVALID_CLIENT
OAuth2Error.INVALID_GRANT
OAuth2Error.UNAUTHORIZED_CLIENT
OAuth2Error.UNSUPPORTED_GRANT_TYPE
OAuth2Error.INVALID_SCOPE
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:
Constructor Summary | |
---|---|
protected |
TokenErrorResponse()
Creates a new OAuth 2.0 Access Token error response. |
|
TokenErrorResponse(ErrorObject error)
Creates a new OAuth 2.0 Access Token error response. |
Method Summary | |
---|---|
ErrorObject |
getErrorObject()
Gets the error associated with the error response. |
static Set<ErrorObject> |
getStandardErrors()
Gets the standard OAuth 2.0 errors for an Access Token error response. |
static TokenErrorResponse |
parse(HTTPResponse httpResponse)
Parses an OAuth 2.0 Token Error response from the specified HTTP response. |
static TokenErrorResponse |
parse(net.minidev.json.JSONObject jsonObject)
Parses an OAuth 2.0 Token Error 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected TokenErrorResponse()
public TokenErrorResponse(ErrorObject error)
error
- The error. Should match one of the
standard errors
for a token
error response. Must not be null
.Method Detail |
---|
public static Set<ErrorObject> getStandardErrors()
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 TokenErrorResponse 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 Token Error response.public static TokenErrorResponse 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 Token Error response.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |