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.
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?
context_configuration: [
"branding.settings",
"branding.themes.default",
"client.logo_uri",
"client.description",
"client.metadata.[key_name]",
"organization.display_name",
"organization.branding",
"organization.metadata.[key_name]",
"screen.texts",
"tenant.name",
"tenant.friendly_name",
"tenant.enabled_locales",
"transaction.connection.metadata.[key_name]",
"untrusted_data.submitted_form_data",
"untrusted_data.authorization_params.ui_locales",
"untrusted_data.authorization_params.login_hint",
"untrusted_data.authorization_params.screen_hint",
"untrusted_data.authorization_params.ext-[key_name]"
]
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
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?