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_REQUESTOAuth2Error.INVALID_CLIENTBearerTokenError.MISSING_TOKENBearerTokenError.INVALID_REQUESTBearerTokenError.INVALID_TOKENBearerTokenError.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.booleanChecks 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,nullif 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:ErrorResponseGets the error associated with the error response.- Specified by:
getErrorObjectin interfaceErrorResponse- Returns:
- The error,
nullif none.
-
indicatesSuccess
Description copied from interface:ResponseChecks if the response indicates success.- Specified by:
indicatesSuccessin interfaceResponse- Returns:
trueif the response indicates success, elsefalse.
-
toHTTPResponse
Description copied from interface:ResponseReturns the matching HTTP response.- Specified by:
toHTTPResponsein 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.
-