OAuth2Exception
OAuth2/OIDC error representation for issuer and wallet flows. Use to model protocol errors and serialize them for responses.
Inheritors
Types
RFC6750: The request is missing a required parameter, includes an unsupported parameter or parameter value, repeats the same parameter, uses more than one method for including an access token, or is otherwise malformed. The resource server SHOULD respond with the HTTP 400 (Bad Request) status code.
RFC6750: The access token provided is expired, revoked, malformed, or invalid for other reasons. The resource SHOULD respond with the HTTP 401 (Unauthorized) status code. The client MAY request a new access token and retry the protected resource request.
OpenID4VP 1.0 section 8.5: invalid transaction data, including missing or unmatched credential_ids.
RFC 6749 5.2: The authorization grant type is not supported by the authorization server.
Properties
Functions
Converts this error of an authorization server endpoint (pushed authorization request, token, token introspection, attestation challenge, authorization) to the response to send: status 400 with the toOAuth2Error as JSON (RFC 6749 5.2), including the header DPoP-Nonce for OAuth2Exception.UseDpopNonce (RFC 9449 8.) and OAuth-Client-Attestation-Challenge for OAuth2Exception.UseAttestationChallenge (OA-ABCA 7.4).
Converts this error of a resource endpoint accessed with an access token (credential, userinfo) to the response to send, with the toOAuth2Error as JSON: