Skip to content

Attribute and role mapping

The Attribute Mapping and Role Mapping fieldsets of the provider form tell the module how to read the SAML assertion. These settings apply to each login of the provider.

  • A mapped attribute matches the name or the friendly name of a SAML attribute. The comparison is exact and is case-sensitive.
  • A role rule matches one value of the group attribute exactly.
  • The module ignores empty values.

To see the names that your IdP sends, test the provider. The test result shows each attribute with its name, its friendly name and its values.

The Attribute Mapping fieldset with the Microsoft Entra ID preset loaded. It shows the Load Preset select, the Email, First Name and Last Name Attribute fields, and the empty Additional User Fields and Custom Attributes tables.

Field Description
Load Preset Fills in the usual attribute names of an IdP. Compare them with the claims that your IdP sends. The preset also shows a note with the IdP configuration that the preset needs.
Email Attribute The attribute of the email address. Leave empty to use the NameID as the email address.
First Name Attribute The attribute of the first name.
Last Name Attribute The attribute of the last name.
Additional User Fields Other admin user fields that an IdP attribute fills. By default, the only field is Interface Locale.
Custom Attributes IdP attributes that the module keeps with the linked identity at each login, such as a department or an employee number.

The email address identifies the admin user. If Email Attribute is empty, or if a login does not have the mapped attribute, the module uses the NameID. The NameID gives the email address in these conditions:

  • The NameID has the email address format.
  • The NameID has no format or the unspecified format, and its value is an email address.

With the Persistent Identifier format, you must set an email attribute.

Each custom attribute has a code and an IdP attribute. The code starts with a lowercase letter. It contains only lowercase letters, digits and _, and has 64 characters or fewer. Two custom attributes cannot have the same code.

The module saves the values of the last login on the linked identity. Other modules can read these values. Refer to Extending the module.

Preset Email attribute Group attribute
Microsoft Entra ID http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress http://schemas.microsoft.com/ws/2008/06/identity/claims/groups
AD FS http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress http://schemas.xmlsoap.org/claims/Group
Okta email groups
Google Workspace / Cloud Identity email groups
AWS IAM Identity Center email groups
Keycloak urn:oid:1.2.840.113549.1.9.1 Role
Auth0 http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress http://schemas.xmlsoap.org/claims/Group
PingOne / PingID email groups
Shibboleth / eduPerson (OIDs) urn:oid:0.9.2342.19200300.100.1.3 urn:oid:1.3.6.1.4.1.5923.1.5.1.1

For the first name and last name attributes of each preset, refer to the identity provider guides.

Field Description
Group Attribute The IdP attribute that lists the groups or the roles of the user.
Role Rules Each rule has a Group Value and an Admin Role.
Update Role At Each Login When on, each login sets the role of the user from the rules. When off, the rules give a role only to the users that the provider creates.
Deny Users Without A Matching Rule When on, the module refuses the login of a user that matches no rule.
  1. The module reads the values of the group attribute.

  2. The module examines the rules in their order. The first rule that matches a value gives the role.

  3. If no rule matches and Deny Users Without A Matching Rule is on, the module refuses the login.

  4. If no rule matches and the option is off, the user gets the Role For Provisioned Users. With Update Role At Each Login on, this also applies to an existing user at each login.

To change the order of the rules, drag the rows. Each group value can have only one rule.

These conditions apply when you save the provider:

  • Role rules need a group attribute.
  • Update Role At Each Login and Deny Users Without A Matching Rule need at least one rule.
  • Each rule needs a group value and an admin role.

The module uses these rules at each login, in this order:

  1. Linked identity. If the provider linked the NameID before, the module uses the admin user of this identity.
  2. Email address. If not, the email address must belong to a domain of the provider. The module links the admin user with this email address. This also applies when the IdP changes the NameID of a linked user.
  3. Provisioning. If no admin user has the email address and Create Admin User On First Login is on, the module creates an admin user.

A provider can never take control of an account of a domain that is not one of its domains.

The username of a new admin user is its email address. If the email address has more than 40 characters, the username is SSO_ and a hash of the email address. If another user has this username, the username is SSO_ and a random value.

A login never changes the username or the email address of an existing admin user.

The module refuses a login when the admin user is inactive, is locked, has expired or has no role.

At each login, the module copies the mapped fields to the admin user. Thus the fields stay the same as at the IdP. The module does not copy an interface locale that Magento does not have.

SSO manages these fields of an admin user:

  • The email address and the username, always.
  • Each field that a provider of the user maps to an IdP attribute.
  • The role, when a provider of the user has Update Role At Each Login on.

On My Account and on the user edit form, the managed fields are disabled. A notice tells the user that the identity provider manages them. The password fields are not on the form, because the user has no password. Other fields stay editable.

The My Account page of an SSO-managed admin user. The user name, first name, last name and email fields are disabled, and a notice tells the user that the identity provider manages them.