CodeAuthFlow

@ObjCName(swiftName = "AbstractCodeAuthFlow", name = "AbstractCodeAuthFlow", exact = true)
abstract class CodeAuthFlow(val client: OpenIdConnectClient)

Implements the OAuth 2.0 Code Authorization Flow. See: RFC6749

Implementations have to provide their own method getAuthorizationCode as this requires user interaction (e.g. via browser).

Inheritors

Constructors

Link copied to clipboard
constructor(client: OpenIdConnectClient)

Properties

Link copied to clipboard

Functions

Link copied to clipboard

For some reason the default parameter is not available in Platform implementations, so this provides an empty parameter method instead.

suspend fun getAccessToken(configure: HttpRequestBuilder.() -> Unit? = null): AccessTokenResponse
suspend fun getAccessToken(configureAuthUrl: URLBuilder.() -> Unit? = null, configureTokenExchange: HttpRequestBuilder.() -> Unit? = null): AccessTokenResponse

Start the authorization flow to request an access token.

Link copied to clipboard
abstract suspend fun getAuthorizationCode(request: AuthCodeRequest): AuthCodeResponse

Uses the request URL to open a browser and perform authorization.