AuthorizationCodeFlow

A Java-friendly wrapper around the Kotlin KotlinAuthorizationCodeFlow.

This class combines the start and resume steps into a single start method that uses a BrowserRedirectHandler to open the browser and capture the redirect callback. Java consumers can use CompletableFuture without dealing with Kotlin coroutines.

Typical Java usage:

AuthorizationCodeFlow flow = new AuthorizationCodeFlow(kmpClient);
TokenInfo token = flow.start(redirectUrl, browserHandler).get();
flow.close();

Must be closed when no longer needed to release coroutine resources.

Parameters

delegate

the underlying Kotlin KotlinAuthorizationCodeFlow instance.

Constructors

Link copied to clipboard
constructor(delegate: AuthorizationCodeFlow)
constructor(client: OAuth2Client)

Creates an AuthorizationCodeFlow backed by the given KmpOAuth2Client.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
fun start(redirectUrl: String, browserRedirectHandler: BrowserRedirectHandler, extraRequestParameters: Map<String, String> = emptyMap(), scope: String = "openid profile email offline_access"): CompletableFuture<TokenInfo>

Performs the full Authorization Code flow asynchronously.