OAuth2Client

class OAuth2Client(    val clientId: String = "https://wallet.a-sit.at/app",     val redirectUrl: String = "/callback",     stateToCodeStore: MapStore<String, String> = DefaultMapStore(),     val jwsService: JwsService? = DefaultJwsService(DefaultCryptoService(EphemeralKeyWithSelfSignedCert())))(source)

Simple OAuth 2.0 client to authorize the client against an OAuth 2.0 Authorization Server and request tokens.

Can be used in OID4VCI flows, e.g. WalletService.

Constructors

Link copied to clipboard
constructor(    clientId: String = "https://wallet.a-sit.at/app",     redirectUrl: String = "/callback",     stateToCodeStore: MapStore<String, String> = DefaultMapStore(),     jwsService: JwsService? = DefaultJwsService(DefaultCryptoService(EphemeralKeyWithSelfSignedCert())))

Types

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard

Set this variable to use JAR (JWT-secured authorization requests, RFC 9101) for PAR (Pushed authorization requests, RFC 9126), as mandated by OpenID4VC HAIP.

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun createAuthRequest(    state: String,     authorizationDetails: Set<AuthorizationDetails>? = null,     scope: String? = null,     resource: String? = null,     issuerState: String? = null,     audience: String? = null,     wrapAsPar: Boolean = true): AuthenticationRequestParameters
Link copied to clipboard

Send the result as parameters to the server at OAuth2AuthorizationServerMetadata.authorizationEndpoint. Use this method if the previous authn request was sent as a pushed authorization request (RFC 9126), and the server has answered with PushedAuthenticationResponseParameters.

Link copied to clipboard
suspend fun createTokenRequestParameters(    authorization: OAuth2Client.AuthorizationForToken,     state: String? = null,     authorizationDetails: Set<AuthorizationDetails>? = null,     scope: String? = null,     resource: String? = null): TokenRequestParameters

Request token with an authorization code, e.g. from createAuthRequest, or pre-auth code.

Link copied to clipboard
suspend fun generateCodeVerifier(state: String): String