InteractionCodeFlow

The InteractionCodeFlow class is used to define and initiate an authentication workflow utilizing the Okta Identity Engine.

Usage: call start to begin the workflow, then resume to retrieve the initial IdxResponse. From there, repeatedly set the desired form field values on a remediation and call proceed to advance through the workflow until IdxResponse.isLoginSuccessful is true, then call exchangeInteractionCodeForTokens to obtain tokens. All of these are suspend functions and must be called from a coroutine. An InteractionCodeFlow instance is stateful: it retains the context created by start and must not be reused concurrently for unrelated authentication attempts.

Constructors

Link copied to clipboard
constructor(client: OAuth2Client)

Initializes a new InteractionCodeFlow, using the given client.

constructor()

Initializes a new InteractionCodeFlow.

constructor(oidcConfiguration: OidcConfiguration)

Initializes a new InteractionCodeFlow.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The OAuth2Client used to make authorization-server requests for this flow.

Functions

Link copied to clipboard

Evaluates the given redirect url to determine what next steps can be performed. This is usually used when receiving a redirection from an IDP authentication flow.

Link copied to clipboard

Exchanges the IdxRemediation.Type.ISSUE remediation for tokens once IdxResponse.isLoginSuccessful is true.

Link copied to clipboard

Executes the given remediation and advances the workflow using the values currently set on its form fields.

Link copied to clipboard

Resumes the authentication state to identify the available remediation steps.

Link copied to clipboard
suspend fun start(redirectUri: Uri, extraStartRequestParameters: Map<String, String> = emptyMap()): OAuth2ClientResult<Unit>

Starts the authentication session. Returns an empty OAuth2ClientResult.Success on success, and a OAuth2ClientResult.Error with the corresponding exception on failure.