1: The user navigates to the sign-in page
When the user navigates to your app's sign-in page, call OktaAuth.idx.start()
to start the sign-in flow.
The method returns an IdxTransaction
object that contains field metadata that you can use to create a sign-in page dynamically.
Display — either statically or dynamically using IdxTransaction
— an input field for the user's username.
2: The user submits their username
When the user submits their username, create an object with a username
property and assign it the value entered by the user.
Call OktaAuth.idx.proceed()
passing in this new object as a parameter.
Note: You can also start the sign-in flow in a single step by passing the username as a parameter to OktaAuth.idx.authenticate()
. See idx.authenticate
(opens new window) in the GitHub docs or the Node Express version of this guide to learn more.
3. Identity Engine requests email verification
Identity Engine sends the user an email that contains a one-time passcode (OTP) they can use to verify their identity. OktaAuth.idx.proceed()
returns an IdxTransaction
object with a status
of PENDING
, indicating that the user needs to verify their identity with their email.
Build the logic that handles this response and sends the user to a dialog where they enter the OTP.
4. The user verifies their identity with their email
The user opens the email sent by Identity Engine. Create a dialog in your app where the user can submit the OTP from the email to Identity Engine.
When the user submits the OTP, create an object with a verificationCode
property set to the OTP entered by the user.
Call OktaAuth.idx.proceed()
passing in the new object as a parameter.
5. Identity Engine verifies OTP and returns success
OktaAuth.idx.proceed()
returns IdxTransaction.status
equal to SUCCESS
along with access and ID tokens, which indicates a successful user sign-in flow.
Store these tokens for future requests and redirect the user to the default page after a successful sign-in attempt.
Note: In other use cases where additional sign-in authenticators are required, the user must choose and verify all required authenticators before IdxTransaction.status
of SUCCESS
is returned.