1: The user navigates to the sign-in page
When the user navigates to your app's sign-in page, display a link on your app's sign-in page that points to a sign-up page.
2: The user clicks the sign-up link
When the user clicks Sign up, redirect them to the page where they can sign up for a new account. During page load, call OktaAuth.idx.register()
to start the self-service registration flow.
The method returns an IdxTransaction
object that contains field metadata that you can use to create a registration page dynamically.
Display — either statically or dynamically using IdxTransaction
— input fields for the user's first name, last name, and email.
3: The user submits their new account details
When the user submits their account details, create an object with firstName
, lastName
, and email
properties and assign them the values entered by the user.
Note: The email
property represents the account's username and primary email address.
Send this new object to OktaAuth.idx.proceed()
.
Note: You can also start the registration flow in a single step by passing the account details in OktaAuth.idx.register()
. See idx.register
(opens new window) in the GitHub docs or Node Express's version of this guide to learn more.
4. Identity Engine requests new 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.
5. The user verifies their identity with the new 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 back 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.
6. Your app displays the remaining optional authenticators
After the user verifies their identity using the email authenticator, OktaAuth.idx.proceed()
returns an IdxTransaction
object indicating that the user has the option to enroll in additional authenticators. The IdxTransaction.nextStep.canSkip
property is set to true
, which indicates the remaining authenticators are optional.
Display a page that lists the remaining authenticators and allows the user to skip registering any more.
Note: In other use cases where there are additional required authenticators, IdxTransaction.nextStep.canSkip
equals false
and the Skip button should be omitted.
7. The user skips the remaining optional authenticators
When the user clicks the Skip button, call OktaAuth.idx.proceed()
passing in an object with a skip
property equal to true
.
OktaAuth.idx.proceed()
returns IdxTransaction.status
equal to SUCCESS
along with access and ID tokens, which indicates a successful new user sign-up flow.
Store these tokens for future requests and redirect the user to the default page after a successful sign-up attempt.