1: Your app displays sign-up link on sign-in page
Add a link to your app's sign-in page. When the user clicks this link, redirect them to a sign-up page where they can sign up for a new account.
2: Your app displays sign-up page
Create a sign-up page that captures the user's first name, last name, and email address.
3: The user submits their new account details
When the user submits their account details, create a UserProfile
object and assign its firstName
, lastName
, and email
properties to the values entered by the user. Pass this object as a parameter to IdxClient.RegisterAsync()
.
Note: The email
property represents the account's username and primary email address.
4. The user verifies their identity using the email authenticator
RegisterAsync()
returns an AuthenticationResponse
object. Query its AuthenticationStatus
property to discover the current status of the authentication process. A status of AwaitingAuthenticatorEnrollment
indicates that the user needs to verify their identity with the email authenticator challenge.
The email authenticator supports user verification by one-time passcode (OTP) and by magic links. To learn more, see the Okta email integration guide.
5. Your app displays the remaining optional authenticators
After the user verifies their identity using the email authenticator, the status of the authentication process is AwaitingAuthenticatorEnrollment
.
Create and display a page that lists the remaining authenticators. Check the CanSkip
property of the AuthenticationResponse
object. If true
— and all the listed authenticators are optional — add a Skip button to the form to skip their enrollment. If CanSkip
is false
, you should omit the Skip button.
6. The user skips the remaining optional authenticators
When the user clicks the Skip button, call IdxClient.SkipAuthenticationSelectionAsync()
passing in the IdxContext
object that represents the current state of the registration flow.
After the user skips the remaining optional authenticators, the current status of the authentication process is now Success
. Call AuthenticationHelper.GetIdentityFromTokenResponseAsync()
to retrieve the user's OIDC claims information and pass it into your application. The user has now signed in.
Store these tokens for future requests and redirect the user to the default page after a successful sign-up attempt.