start

fun start(redirectUrl: String, browserRedirectHandler: BrowserRedirectHandler, scope: List<String>, extraRequestParameters: Map<String, String> = emptyMap()): CompletableFuture<TokenInfo>

Performs the full Authorization Code flow asynchronously.

Opens redirectUrl in a browser via browserRedirectHandler, waits for the redirect callback, and exchanges the authorization code for tokens.

Return

a CompletableFuture that completes with TokenInfo on success, or completes exceptionally on failure — including with KotlinAuthorizationCodeFlow.PushedAuthorizationRequiredException when the authorization server requires PAR, but it cannot be used, or KotlinAuthorizationCodeFlow.PushedAuthorizationRequestException when a PAR request fails and fallback is disabled (retrievable via ExecutionException.getCause()).

Parameters

redirectUrl

the registered redirect URI for this client.

browserRedirectHandler

handles opening the browser and capturing the redirect.

scope

the scopes to request.

extraRequestParameters

additional authorization endpoint parameters.