Note: The examples in this guide use Java 11 and Spring Boot MVC.
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, call IDXAuthenticationWrapper.begin()
to start the authentication flow and then getProceedContext()
to retrieve its current state.
Create a UserProfile
object and assign its firstName
, lastName
, and email
attributes to the values entered by the user. Pass this object as a parameter to IDXAuthenticationWrapper.register()
.
Note: The email
property represents the account's username and primary email address.
4. The user verifies their identity using the email authenticator
register()
returns an AuthenticationResponse
object. Query its AuthenticationStatus
property to discover the current status of the authentication process. A status of AWAITING_AUTHENTICATOR_ENROLLMENT_SELECTION
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 AWAITING_AUTHENTICATOR_ENROLLMENT_SELECTION
. Create and display a page that lists the remaining authenticators. Call isSkipAuthenticatorPresent()
on the current context of the flow.
If true
— and all the listed authenticators are optional — add a Skip button to the form to skip their enrollment. If false
, you should omit the Skip button.
6. The user skips the remaining optional authenticators
When the user clicks the Skip button, call IDXAuthenticationWrapper.skipAuthenticatorEnrollment()
. After the user skips the remaining optional authenticators, the authentication process's status is SKIP_COMPLETE
. Call AuthenticationResponse.getTokenResponse()
to retrieve the required access, refresh and ID tokens to 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. In the example above, this is achieved using homeHelper
(opens new window).proceedToHome()
.