Auth0
Use the SAML2 Web App addon of an Auth0 application. The addon sends the claims of the preset by default.
Preset values
Section titled “Preset values”The Auth0 preset fills in these attributes:
| Field | Attribute |
|---|---|
| Email Attribute | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress |
| First Name Attribute | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname |
| Last Name Attribute | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname |
| Group Attribute | http://schemas.xmlsoap.org/claims/Group |
The import selects this preset when the IdP entity ID starts with urn:auth0: or is urn:<tenant>.auth0.com.
Before you start
Section titled “Before you start”Create the provider in Magento, and save it as inactive. Copy the SP Entity ID and the ACS URL from the Service Provider fieldset.
Configure Auth0
Section titled “Configure Auth0”-
In the Auth0 Dashboard, create a Regular Web Application.
-
Open the Addons tab, and turn on SAML2 Web App.
-
In Application Callback URL, enter the ACS URL of Magento.
-
In the settings JSON, set
audienceto the SP Entity ID of Magento. -
Download the identity provider metadata from the Usage tab of the addon.
-
Turn on the connections of the users that can sign in to Magento.
Auth0 settings at a glance
Section titled “Auth0 settings at a glance”| Auth0 setting | Value |
|---|---|
| Application type | Regular Web Application |
| Addon | SAML2 Web App |
| Application Callback URL | ACS URL |
audience in the settings JSON |
SP Entity ID |
| Identity provider metadata | On the Usage tab of the addon. Import this file in Magento. |
| Attribute name | Source at Auth0 | Note |
|---|---|---|
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress |
email |
Default |
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname |
given_name |
Default |
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname |
family_name |
Default |
http://schemas.xmlsoap.org/claims/Group |
groups |
Default, when the profile has groups |
amr |
A post-login Action | Optional |
The attribute names must be exactly the same as in the Magento attribute mapping. To see the names that Auth0 sends, test the provider.
Configure Magento
Section titled “Configure Magento”-
Open the provider in Magento.
-
Click Import Metadata, and select the metadata file of Auth0.
-
In Attribute Mapping > Load Preset, select Auth0, if the import did not select it.
-
Examine the imported values, and the note of the preset.
-
In Your Password, enter your current admin password.
-
Click Save and Continue Edit.
-
Click Test Connection, and sign in with a test user.
-
If the test succeeds, turn on Active, and save the provider again.
-
Add and verify the domain of the users.
Groups and roles
Section titled “Groups and roles”The addon sends groups only when the user profile has groups. For the role rules, refer to Role mapping.
Two-factor authentication
Section titled “Two-factor authentication”To let a passkey or a security key sign-in replace the two-factor authentication of Magento, add a post-login Action with this call:
api.samlResponse.setAttribute('amr', event.authentication.methods.map(m => m.type ?? m.name));Common problems
Section titled “Common problems”| Problem | Solution |
|---|---|
| The NameID is not an email address. | By default, the NameID of Auth0 is the user ID. Keep the email attribute of the preset. The module then uses the email claim. |
For more problems, refer to Troubleshooting.