DeviceAuthorizationFlow

Implements the Device Authorization Grant flow.

Use start to obtain a DeviceAuthorizationFlowContext containing the user code and verification URI to display to the user, then poll resume until the user completes authorization or the session expires.

val flow = DeviceAuthorizationFlow(client)
val ctx = flow.start().getOrThrow()
println("Visit ${ctx.verificationUriComplete} and enter ${ctx.userCode}")
val tokenInfo = flow.resume(ctx).getOrThrow()

Types

Link copied to clipboard
object Companion
Link copied to clipboard

An error due to the authorization session expiring before the user completed sign in.

Functions

Link copied to clipboard
abstract suspend fun resume(flowContext: DeviceAuthorizationFlowContext): ERROR CLASS: Symbol not found for Result<ERROR CLASS: Symbol not found for TokenInfo>

Polls the token endpoint until the user authorizes or the session expires.

Link copied to clipboard
abstract suspend fun start(scope: String = "openid profile email offline_access"): ERROR CLASS: Symbol not found for Result<com/okta/oauth2/kmp/DeviceAuthorizationFlowContext>

Initiates the device authorization flow.