OAuth2Client
class OAuth2Client(val clientId: String = "https://wallet.a-sit.at/app", val 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
Properties
Link copied to clipboard
Used to create AuthenticationRequestParameters, TokenRequestParameters and CredentialRequestProof, typically a URI.
Link copied to clipboard
Used to create AuthenticationRequestParameters and TokenRequestParameters.
Functions
Link copied to clipboard
suspend fun createAuthRequest(state: String, authorizationDetails: Set<AuthorizationDetails>? = null, scope: String? = null, resource: String? = null, issuerState: 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.
Link copied to clipboard