SimpleAuthorizationService
Simple authorization server implementation, to be used for OpenId4VciServer, with the actual authentication and authorization logic for credential schemes implemented in strategy.
Implemented from OpenID for Verifiable Credential Issuance 1.0 from 2025-09-16. Also implements necessary parts of OpenID4VC HAIP , Draft 03, 2025-02-07, e.g. OAuth 2.0 Pushed Authorization Requests, Proof Key for Code Exchange by OAuth Public Clients, OAuth 2.0 Demonstrating Proof of Possession (DPoP), OAuth 2.0 Attestation-Based Client Authentication OAuth 2.0 Token Introspection JWT Response for OAuth Token Introspection OAuth 2.0 Token Exchange
Constructors
Properties
Used in several fields in OAuth2AuthorizationServerMetadata, to provide endpoint URLs to clients.
Functions
Provides a challenge for the challenge endpoint, send it converted with AttestationChallengeResponse.toHttpResponse. See OAuth 2.0 Attestation-Based Client Authentication
Builds the authentication response for this specific user from loadUserFun. Send this result converted with AuthenticationResponseResult.Redirect.toHttpResponse.
If this is an internal AS, provide a fresh DPoP nonce for clients.
Obtains information about the token, since we're in-memory here (as an OAuth2AuthorizationServerAdapter, we can directly access our tokenService.
Obtains a JSON object representing at.asitplus.openid.OidcUserInfo from the Authorization Server, and since we're implementing OAuth2AuthorizationServerAdapter here, this is the same as userInfo, i.e. the access token is validated before any user info is returned.
Serve this result under /.well-known/openid-configuration, see OpenIdConstants.WellKnownPaths.OpenidConfiguration, and under /.well-known/oauth-authorization-server, see OpenIdConstants.WellKnownPaths.OauthAuthorizationServer, converted with OAuth2AuthorizationServerMetadata.toHttpResponse.
Offer some credential identifiers from strategy to clients with auth-code flow.
Offer all available schemes from strategy to clients.
Pushed authorization request endpoint as defined in RFC 9126. Clients send their authorization request as HTTP POST with application/x-www-form-urlencoded to the AS.
Like par, but also provides a fresh DPoP nonce and, with attestation-based client authentication, a fresh attestation challenge for the success response headers; send it converted with toHttpResponse(). See RFC 9449 8. Authorization Server-Provided Nonce, OA-ABCA 6.2
Verifies the authorization code sent by the client and issues an access token, uses tokenService. Send the result of tokenWithDpopNonce converted with toHttpResponse(), which sets the headers the token response needs.
Answers with a TokenIntrospectionJwtResponse (RFC 9701) when the Accept header of httpRequest asks for application/token-introspection+jwt, which needs an AuthenticatedClient, the resource server, as aud (RFC 9701 5.); else with a TokenIntrospectionResponse.
Like token, but also provides a fresh DPoP nonce and, with attestation-based client authentication, a fresh attestation challenge for the success response headers; send it converted with toHttpResponse(). See RFC 9449 8. Authorization Server-Provided Nonce, OA-ABCA 6.2
Returns the user info associated with this access token, when the token in authorizationHeader is correct.
Like userInfo, but also provides a fresh DPoP nonce for the success response header; send it converted with toHttpResponse(). See RFC 9449 9. Resource Server-Provided Nonce
Validates the access token sent to OpenId4VciServer.credential.