RemoteOAuth2AuthorizationServerAdapter

constructor(publicContext: String, httpClient: HttpClient, internalTokenVerificationService: TokenVerificationService, oauth2Client: OAuth2Client = OAuth2Client(), clientAttestation: ClientAttestation? = null, verifyTokenIntrospectionJwt: VerifyJwsObjectFun? = null, dpopNonceService: NonceService = DefaultNonceService(), scope: CoroutineScope = CoroutineScope(Dispatchers.IO))(source)

Parameters

publicContext

base URL of the remote Authorization Server

httpClient

the app's ktor client, i.e. with its engine and logging. The requests are sent with a copy that does not follow redirects, see OAuth2KtorClient for the plugins it must not have.

internalTokenVerificationService

validates access tokens received in validateAccessToken

oauth2Client

implements OAuth 2.0 when exchanging Wallet's token for a fresh access token

clientAttestation

authenticates with OAuth 2.0 Attestation-Based Client Authentication at the remote Authorization Server, or null to not use it

verifyTokenIntrospectionJwt

verifies the signature of JWT responses of token introspection (RFC 9701) against the keys of the remote Authorization Server; when set, token introspection requests and accepts only JWT responses, when null (the default) plain JSON responses

dpopNonceService

used to provide DPoP nonces for credential requests, which will be verified by internalTokenVerificationService

scope

CoroutineScope to fetch the authorization server's metadata


constructor(publicContext: String, engine: HttpClientEngine, cookiesStorage: CookiesStorage? = null, httpClientConfig: HttpClientConfig<*>.() -> Unit? = null, scope: CoroutineScope = CoroutineScope(Dispatchers.IO), oauth2Client: OAuth2KtorClient = OAuth2KtorClient( engine = engine, cookiesStorage = cookiesStorage, httpClientConfig = httpClientConfig, oAuth2Client = OAuth2Client(), ), internalTokenVerificationService: TokenVerificationService, dpopNonceService: NonceService = DefaultNonceService())(source)

Deprecated

Pass the app's HttpClient instead of engine, cookiesStorage and httpClientConfig, which oauth2Client ignored when passed, and configure the OAuth 2.0 client with oauth2Client, clientAttestation and verifyTokenIntrospectionJwt

Parameters

publicContext

Base URL of the remote Authorization Server.

engine

ktor engine to make requests to the verifier.

cookiesStorage

Callers are advised to implement a persistent cookie storage, to keep the session at the issuing service alive after receiving the auth code.

httpClientConfig

Additional configuration for building the HTTP client, e.g., callers may enable logging.

scope

CoroutineScope to fetch the authorization server's metadata.

oauth2Client

OAuth 2.0 client to use when exchanging Wallet's token for a fresh access token, make sure to configure it to use the correct OAuth2KtorClient.clientAttestation.

internalTokenVerificationService

Validates access tokens received in validateAccessToken.

dpopNonceService

Used to provide DPoP nonces for credential requests, which will be verified by internalTokenVerificationService.