Using Passwordless Authentication on Android with SMS

This functionality has been deprecated in native. After June 2017, tenants cannot use the native passwordless flow. The functionality will continue to work for tenants that currently have it enabled. If at some point the passwordless mode feature is changed or removed from service, customers who currently use it will be notified beforehand and given ample time to migrate.

With the SMS connection, the user is requested to enter a phone number. Auth0 then uses Twilio to send a one time code to that number.

Once the user enters this code into your application, a new user will be created in the sms connection. The user is then authenticated by Auth0.

If the phone number matches an existing user, Auth0 just authenticates the user:

On mobile platforms, your application will receive an ID Token, the user profile and, optionally, a Refresh Token.


Open an account with Twilio

You will need a Twilio Account SID and a Twilio Auth Token. These are the Twilio API credentials that Auth0 will use to send an SMS to the user.

Configure the connection

In the Dashboard under Connections > Passwordless, set the SMS slider to the right to enable the SMS Passwordless feature.

Enter your Twilio Account SID and Twilio Auth Token in the appropriate fields.

For information on obtaining a Twilio SID and Auth Token, see: How to create an Application SID and Auth Tokens and how to change them.

Select the SMS Source that users will see as the sender of the SMS.

For information on using Copilot, see: Sending Messages with Copilot.

Enter either your Twilio Messaging Service SID or a From phone number, depending on the SMS Source selected above.

Lastly, enter the Message that will appear in the body of the SMS.

The @@password@@ placeholder in the Message will be automatically replaced with the one-time password that is sent to the user.

Click SAVE.

Multi-Language Support

The Message area supports usage of multiple languages.

By making a call to the /passwordless/start authentication endpoint, you can set the value of an 'x-request-language' header to the language of your choice. If the value of this header is not set, the language will be extracted from the value in the 'accept-language' header that is automatically set by the browser.

The Message area accepts Liquid syntax. You can use this syntax, combined with exposed parameter values, to programmatically construct elements of the message. For example, you can reference the request_language parameter to change the language of the message:

{% if request_language contains 'dutch' %}
   Hier is uw verificatie code: {{ password }}
{% endif %}

{% if request_language contains 'fr-FR' %}
   Ceci est votre code: {{ password }}
{% endif %}

The following parameters are available when defining the template:

Exposed Parameter Description
password or code the password to use
phone_number the user's phone number the name of the application name where the user is signing up
request_language the requested language for the message content

Enable your apps

Go to the Apps tab of the SMS settings and enable the apps for which you would like to use Passwordless SMS.


For detailed information on how to implement this, refer to Lock Passwordless for Android documentation.