Authenticate Your UsersOnboarding Modal
Authenticate User via Onboarding Modal
Learn how to trigger and handle authentication using the Okto Onboarding Modal.
Methods Overview
Method | Description |
---|---|
asyncopenOnboarding | Opens the Okto Onboarding flow with your chosen primaryAuth (e.g., Email, Phone, or Google) and brand data |
Show Onboarding Modal
openOnboarding(...)
presents a guided onboarding flow to the user. This includes brand data, theming, and whichever primaryAuth
type you’ve set in the openOnboarding()
parameters. Under the hood, it launches a WebView that takes the user through various authentication options (Email OTP, Phone OTP, Google OAuth, etc.).
Parameters
Parameter | Type | Description |
---|---|---|
context | BuildContext | The Flutter build context. (Required) |
gAuthCallback | Future<String> Function() | A function that returns a Google ID token (if using AuthType.GAUTH ). |
onLoginSuccess | Function | Callback triggered once the user completes onboarding successfully. |
primaryAuth | AuthType | Set your default authentication flow. E.g. AuthType.EMAIL , AuthType.PHONE , AuthType.GAUTH . |
title | String | A title for brand customization (optional). |
iconUrl | String | A brand icon URL (optional). |
subtitle | String | A subtitle for brand customization (optional). |
Theming parameters | String (color in hex) | Additional theming (text colors, background, accent, etc.). |
Response
Success Response
Field Name | Type | Description |
---|---|---|
result | Future<void> | Returns no meaningful response on success. |