How it works
When a new user receives a code and enters it for the first time in your application, their user profile is created on thesms
connection before being authenticated by Auth0.
If the phone number that the OTP was sent to matches an existing user, Auth0 authenticates the user:
Embedded Login

Universal Login

Configure the phone provider
- In the Auth0 Dashboard, navigate to Branding > Phone Provider.
-
Enable the Phone Message Provider toggle.
-
Select your phone message provider.
- To use Twilio, follow Configure Twilio as a Phone Messaging Provider.
- To use a custom provider, follow Configure a Custom Phone Provider to use Auth0 Actions.
- Select your delivery method.
- Save your changes.
Legacy SMS gateway
If Auth0 Action’s custom phone provider cannot support your use case, you can manage the custom SMS gateway on passwordless SMS connections with . To learn more, read Set Up Custom SMS Gateway for Passwordless Connections.Configure Passwordless SMS settings
-
In Message, enter the body text of the SMS.
The
@@password@@
placeholder will automatically be replaced with the one-time password that is sent to the user. -
Adjust settings for your OTP Expiry and OTP Length.
- Only the last one-time password (or link) issued will be accepted. Once the latest one is issued, any others are invalidated. Once used, the latest one is also invalidated.
- Only three failed attempts to input the one-time password are allowed. After this, a new code will need to be requested.
- The one-time password issued will be valid (by default) for three minutes before it expires.
- If you choose to extend the amount of time it takes for your one-time password to expire, you should also extend the length of the one-time password code. Otherwise, an attacker has a larger window of time to attempt to guess a short code.
- Decide if you want to Disable Sign Ups. If you enable this setting, you can allow passwordless access for only existing users, but may expose your application to the threat of user enumeration attacks. To learn more, read Passwordless Connections Best Practices.
- Select Save.
Multi-language support
The Message area supports multiple languages. To specify a language, call the Auth0 Authentication API Get Code or Link endpoint and set the value of thex-request-language
header. When this header is not set, the language is extracted from the accept-language
header, which is automatically set by the browser.
Message syntax
The Message area accepts Liquid syntax. You can use this syntax, combined with parameter values, to programmatically construct elements of the message. For example, you can reference therequest_language
parameter to change the language of the message:
Parameter | Description |
---|---|
password or code | The password to use. |
phone_number | The user’s phone number. |
application.name | The name of the application with which the user is signing up. |
request_language | The requested language for message content. |