Phone Identifier Challenge Screen

The Phone Identifier Challenge screen is part of the Identifier First Authentication flow and verifies the user's phone number before allowing them to sign up. For more details, review Activate and Configure Attributes for Flexible Identifiers.

phoneidentifierchallenge

Context Data

The Universal Login Context Data contains unique-per-screen transaction and configuration data. Optional context data can be configured in the Management API with the context_configuration parameter. Read Universal Login Context for information about context data and read Configure Screens for details about optional context data.

interface PhoneIdentifierEnrollment {
  client: Client;
  organization?: Organization;
  prompt: Prompt;
  screen: {
    name: string;
    data: {
      phone: string;
    };
  }
  transaction: Transaction;
};

Was this helpful?

/

Accessing Context Data

Using the Auth0 ACUL JS SDK to access the context data for each screen is recommended. The SDK provides properties and methods that simplify accessing the data.

Initialize the PhoneIdentifierChallenge class to access its properties and methods.

import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';
const phoneIdentifierChallengeManager = new PhoneIdentifierChallenge();

// SDK Properties return a string, number or boolean
// ex. "phone-identifier-challenge"
phoneIdentifierChallengeManager.screen.name;

// SDK Methods return an object or array
// ex. data: { message_type: "text", phone: "+1234567890" };
phoneIdentifierChallengeManager.screenData();

Was this helpful?

/

SDK Properties & Methods

The following groups of properties and methods are available on all screens. To learn more, read Auth0 ACUL JS SDK Shared Properties.

Property or Method Group Description
branding Information about the branding settings and default theme.
client Information about the client (i.e. Auth0 Application).
organization Information about the organization. This is only present if the client is part of an organization.
prompt Information about the current prompt.
screen Information about the current screen.
tenant Information about the Auth0 tenant.
transaction Information about the current authentication transaction.
unstrustedData Information submitted by the user that could potentially be unsafe, as well as certain parameters and custom query parameters passed to the /authorize call.

Screen Operations

The Phone Identifier Challenge screen supports the following operations.

Continue with Code

Continue the transaction with the one-time password (OTP) code sent to the phone number provided in the previous step. This operation verifies the provided phone number and allows the user to continue signing up.

JS SDK Method: submitPhoneChallenge()

Parameter Type Required Description
code string Yes The OTP code sent to the phone number.

phoneIdentifierChallenge.submitPhoneChallenge({
    code: "<CodeFieldValue>"
});

Was this helpful?

/

Resend Code

Send a new OTP code to the phone number provided in the previous step.

JS SDK Method: resendCode()

// This method does not support any parameters
phoneIdentifierChallenge.resendCode();

Was this helpful?

/

Go Back

Return the user to the previous step.

JS SDK Method: resendToPrevious()

// This method does not support any parameters
phoneIdentifierChallenge.returnToPrevious();

Was this helpful?

/