AuthorizationService

Provides interface for implementing an OAuth 2.0 Authorization Server, which may be used with an at.asitplus.wallet.lib.oidvci.OAuth2AuthorizationServerAdapter for a at.asitplus.wallet.lib.oidvci.OpenId4VciServer.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun authorize(input: RequestParameters, loadUserFun: OAuth2LoadUserFun): KmmResult<AuthenticationResponseResult.Redirect>

Builds the authentication response for this specific user from loadUserFun. Send this result converted with AuthenticationResponseResult.Redirect.toHttpResponse.

Link copied to clipboard
abstract suspend fun par(request: RequestParameters, httpRequest: RequestInfo? = null): KmmResult<PushedAuthenticationResponseParameters>
abstract suspend fun par(input: String, httpRequest: RequestInfo? = null): KmmResult<PushedAuthenticationResponseParameters>

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.

Link copied to clipboard
abstract suspend fun token(request: TokenRequestParameters, httpRequest: RequestInfo? = null): KmmResult<TokenResponseParameters>

Verifies the authorization code sent by the client and issues an access token. Send the result of SimpleAuthorizationService.tokenWithDpopNonce converted with toHttpResponse(), which sets the headers the token response needs.

Link copied to clipboard
abstract suspend fun tokenIntrospection(request: TokenIntrospectionRequest, httpRequest: RequestInfo? = null): KmmResult<TokenIntrospectionResult>

RFC7662: OAuth 2.0 Token Introspection, with RFC 9701 JWT responses for an Accept header asking for application/token-introspection+jwt. Send the result with its toHttpResponse().

Link copied to clipboard
abstract suspend fun userInfo(authorizationHeader: String, httpRequest: RequestInfo? = null): KmmResult<JsonObject>

Returns the user info associated with this access token, when the token in authorizationHeader is correct.