Package com.nimbusds.oauth2.sdk
Class TokenIntrospectionErrorResponse
java.lang.Object
com.nimbusds.oauth2.sdk.TokenIntrospectionResponse
com.nimbusds.oauth2.sdk.TokenIntrospectionErrorResponse
- All Implemented Interfaces:
ErrorResponse
,Message
,Response
@Immutable
public class TokenIntrospectionErrorResponse
extends TokenIntrospectionResponse
implements ErrorResponse
Token introspection error response.
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:
- OAuth 2.0 Token Introspection (RFC 7662)
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new token introspection error response. -
Method Summary
Modifier and TypeMethodDescriptionGets the error associated with the error response.static Set<ErrorObject>
Gets the standard errors for a token introspection error response.boolean
Checks if the response indicates success.parse
(HTTPResponse httpResponse) Parses a token introspection error response from the specified HTTP response.Returns the matching HTTP response.Methods inherited from class com.nimbusds.oauth2.sdk.TokenIntrospectionResponse
toErrorResponse, toSuccessResponse
-
Constructor Details
-
TokenIntrospectionErrorResponse
Creates a new token introspection error response.- Parameters:
error
- The error,null
if not specified.
-
-
Method Details
-
getStandardErrors
Gets the standard errors for a token introspection error response.- Returns:
- The standard errors, as a read-only set.
-
getErrorObject
Description copied from interface:ErrorResponse
Gets the error associated with the error response.- Specified by:
getErrorObject
in interfaceErrorResponse
- Returns:
- The error,
null
if none.
-
indicatesSuccess
Description copied from interface:Response
Checks if the response indicates success.- Specified by:
indicatesSuccess
in interfaceResponse
- Returns:
true
if the response indicates success, elsefalse
.
-
toHTTPResponse
Description copied from interface:Response
Returns the matching HTTP response.- Specified by:
toHTTPResponse
in interfaceResponse
- Returns:
- The HTTP response.
-
parse
public static TokenIntrospectionErrorResponse parse(HTTPResponse httpResponse) throws ParseException Parses a token introspection error response from the specified HTTP response.- Parameters:
httpResponse
- The HTTP response to parse. Its status code must not be 200 (OK). Must not benull
.- Returns:
- The token introspection error response.
- Throws:
ParseException
- If the HTTP response couldn't be parsed to a token introspection error response.
-