Skip to content

Auth0

Use the SAML2 Web App addon of an Auth0 application. The addon sends the claims of the preset by default.

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.

Create the provider in Magento, and save it as inactive. Copy the SP Entity ID and the ACS URL from the Service Provider fieldset.

  1. In the Auth0 Dashboard, create a Regular Web Application.

  2. Open the Addons tab, and turn on SAML2 Web App.

  3. In Application Callback URL, enter the ACS URL of Magento.

  4. In the settings JSON, set audience to the SP Entity ID of Magento.

  5. Download the identity provider metadata from the Usage tab of the addon.

  6. Turn on the connections of the users that can sign in to Magento.

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.

  1. Open the provider in Magento.

  2. Click Import Metadata, and select the metadata file of Auth0.

  3. In Attribute Mapping > Load Preset, select Auth0, if the import did not select it.

  4. Examine the imported values, and the note of the preset.

  5. In Your Password, enter your current admin password.

  6. Click Save and Continue Edit.

  7. Click Test Connection, and sign in with a test user.

  8. If the test succeeds, turn on Active, and save the provider again.

  9. Add and verify the domain of the users.

The addon sends groups only when the user profile has groups. For the role rules, refer to Role mapping.

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));
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.