Skip to content

AD FS

Use a relying party trust in AD FS. AD FS sends only the claims that the claim rules of the trust issue.

The AD FS 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 ends with /adfs/services/trust.

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 AD FS Management console, add a Relying Party Trust that is claims aware.

  2. Select Import data about the relying party from a file, and select the file from Download SP Metadata. Or enter the data manually.

  3. If you enter the data manually, use the SP Entity ID as the relying party trust identifier.

  4. If you enter the data manually, add a SAML assertion consumer endpoint with the POST binding and the ACS URL.

  5. Select an access control policy for the users that can sign in to Magento.

  6. Add a claim rule of the type Send LDAP Attributes as Claims.

  7. In this rule, map E-Mail-Addresses to E-Mail Address, Given-Name to Given Name and Surname to Surname.

  8. Optional: in the same rule, map Token-Groups - Unqualified Names to Group.

  9. Download the federation metadata of AD FS. The usual path is /FederationMetadata/2007-06/FederationMetadata.xml.

AD FS setting Value
Relying party trust identifier SP Entity ID
SAML Assertion Consumer Endpoint (POST binding) ACS URL
Federation metadata /FederationMetadata/2007-06/FederationMetadata.xml. Import this file in Magento.
Attribute name Source at AD FS Note
E-Mail Address E-Mail-Addresses Send LDAP Attributes as Claims
Given Name Given-Name Send LDAP Attributes as Claims
Surname Surname Send LDAP Attributes as Claims
Group Token-Groups - Unqualified Names Optional
Authentication method references Pass through Optional. For phishing-resistant sign-ins.

The attribute names must be exactly the same as in the Magento attribute mapping. To see the names that AD FS sends, test the provider.

  1. Open the provider in Magento.

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

  3. In Attribute Mapping > Load Preset, select AD FS, 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.

With Token-Groups - Unqualified Names, AD FS sends the names of the Active Directory groups. For the role rules, refer to Role mapping.

To let a certificate and multifactor sign-in replace the two-factor authentication of Magento, add a claim rule that passes the authentication method claims through. The module reads the claim types http://schemas.microsoft.com/claims/authnmethodsreferences and http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod.

A certificate is phishing-resistant only in a multifactor authentication. Alone, it can be the certificate of a device.

Problem Solution
The login fails with “The login has no email address.” The claim rule does not send the email address, or the user has no email address in Active Directory.
You cannot import the SP metadata from a URL. The SP metadata download needs an admin session. Download the file in Magento, and import the file into AD FS.

For more problems, refer to Troubleshooting.