Passwordless Authentication with Magic Links
You can configure a Passwordless connection to send a Magic Link to a user through email to complete authentication.
To learn more, read Configure Email or SMS for Passwordless Authentication.
How it works
When a user opens a Magic Link, Auth0 logs them in directly. It is similar in function to them receiving an email with a one-time password (OTP), returning to your application, and entering the OTP, but without having to actually perform those steps.
Limitations
Magic Links are not supported for Universal Login.
When using Magic Links with Classic Login, both the initial request and its response must take place in the same browser or the transaction will fail. This is particularly relevant for iOS users, who cannot change their default web browser.
For example, the user might make the initial request using the Chrome browser, but when the user opens the Magic Link in their email, iOS automatically opens it in Safari (the default browser). If this happens, the transaction will fail.
Classic Login flow with Magic Links
The user then clicks the button or link in the email and is automatically signed in to your application.
Configure the connection
In the Auth0 Dashboard, go to Authentication > Passwordless, and then enable the Email toggle.
Select Email to open the configuration window, switch to the Settings view, and enter your email's From, Subject, and Message text.
Enter any Authentication Parameters you would like to include in the generated sign-in link.
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 the x-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 the request_language
parameter to change the language of the message:
{% if request_language contains 'dutch' %}
Hier is uw verificatie code: {{ code }}
{% endif %}
{% if request_language contains 'fr-FR' %}
Ceci est votre code: {{ code }}
{% endif %}
Was this helpful?
The following parameters are available when defining the message template:
Parameter | Description |
---|---|
code |
The password to use. |
link |
The generated sign-in link. |
application.name |
The name of the application with which the user is signing up. |
request_language |
The requested language for message content. |
operation |
Indicates when the template has been triggered by an update to a user's email through the API. When triggered, the value is change_email , otherwise it is null . |
Update Classic Login settings
If you are using Classic Login for your application, you must update the page template to implement Magic Links.
In the Auth0 Dashboard, go to Branding > Universal Login > Advanced Options.
Switch to the Login view, locate the Default Templates dropdown, and select Lock (passwordless).
Next, update the
Auth0LockPasswordless
section of code with a new parameter. Add thepasswordlessMethod
to your template.passwordlessMethod: 'link',
Was this helpful?
/Select Save.
To learn more about embedded login configuration options, read Passwordless Authentication with Embedded Login.
Enable applications
Switch to the Applications view, and enable the applications for which you would like to use Passwordless Email.
Email providers
Auth0 sends emails from its own SMTP provider by default. Auth0's built-in email provider is designed solely for testing purposes and does not support customization of email templates.
Configure your own SMTP email provider to manage, monitor, and troubleshoot your email communications, and customize email templates.
Auth0 supports the following email providers: