ResourceOwnerFlow

An authentication flow that implements the Resource Owner Password Grant.

This simple authentication flow permits a user to authenticate using a username and password.

Important: Resource Owner authentication does not support MFA or other more secure authentication models, and is not recommended for production applications.

Example usage:

val flow = ResourceOwnerFlow(client)
val result = flow.start("user@example.com", "password", listOf("openid", "profile"))
result.onSuccess { tokenInfo -> println("Access token: ${tokenInfo.accessToken}") }
result.onFailure { error -> println("Authentication failed: $error") }

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val client: ERROR CLASS: Symbol not found for OAuth2Client

The OAuth2Client instance used for token requests.

Functions

Link copied to clipboard
abstract suspend fun start(username: String, password: String, scope: List<String> = client.configuration.defaultScope): ERROR CLASS: Symbol not found for Result<ERROR CLASS: Symbol not found for TokenInfo>

Initiates the Resource Owner flow by exchanging credentials for tokens.