OAuth2Client

class OAuth2Client(clientId: String = "https://wallet.a-sit.at/app", redirectUrl: String = "/callback", stateToCodeStore: MapStore<String, String> = DefaultMapStore())(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())

Types

Link copied to clipboard

Functions

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

Send the result as parameters (either POST or GET) to the server at /authorize (or more specific OAuth2AuthorizationServerMetadata.authorizationEndpoint).

Link copied to clipboard
suspend fun createTokenRequestParameters(state: String, authorization: OAuth2Client.AuthorizationForToken, 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.