@Immutable public class TokenIntrospectionErrorResponse extends TokenIntrospectionResponse implements ErrorResponse
Standard errors:
OAuth2Error.INVALID_REQUEST
OAuth2Error.INVALID_CLIENT
BearerTokenError.MISSING_TOKEN
BearerTokenError.INVALID_REQUEST
BearerTokenError.INVALID_TOKEN
BearerTokenError.INSUFFICIENT_SCOPE
Example HTTP response:
HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer realm="example.com", error="invalid_token", error_description="The access token expired"
Related specifications:
Constructor and Description |
---|
TokenIntrospectionErrorResponse(ErrorObject error)
Creates a new token introspection error response.
|
Modifier and Type | Method and Description |
---|---|
ErrorObject |
getErrorObject()
Gets the error associated with the error response.
|
static Set<ErrorObject> |
getStandardErrors()
Gets the standard errors for a token introspection error response.
|
boolean |
indicatesSuccess()
Checks if the response indicates success.
|
static TokenIntrospectionErrorResponse |
parse(HTTPResponse httpResponse)
Parses a token introspection error response from the specified HTTP
response.
|
HTTPResponse |
toHTTPResponse()
Returns the matching HTTP response.
|
public TokenIntrospectionErrorResponse(ErrorObject error)
error
- The error, null
if not specified.public static Set<ErrorObject> getStandardErrors()
public ErrorObject getErrorObject()
ErrorResponse
getErrorObject
in interface ErrorResponse
null
if none.public boolean indicatesSuccess()
Response
indicatesSuccess
in interface Response
true
if the response indicates success, else
false
.public HTTPResponse toHTTPResponse()
Response
toHTTPResponse
in interface Response
public static TokenIntrospectionErrorResponse 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 a
token introspection error response.Copyright © 2017 Connect2id Ltd.. All rights reserved.