Skip to content

Google Workspace

Use a custom SAML app in the Google Admin console. Google sends only the attributes that the attribute mapping of the app defines.

The Google Workspace / Cloud Identity preset fills in these attributes:

Field Attribute
Email Attribute email
First Name Attribute firstName
Last Name Attribute lastName
Group Attribute groups

The import selects this preset when the IdP entity ID starts with https://accounts.google.com/o/saml2?idpid=.

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 Google Admin console, go to Apps > Web and mobile apps.

  2. Add a custom SAML app.

  3. Download the IdP metadata.

  4. In ACS URL, enter the ACS URL of Magento.

  5. In Entity ID, enter the SP Entity ID of Magento.

  6. In Name ID format, select EMAIL. In Name ID, select Primary email.

  7. In the attribute mapping, map Primary email to email, First name to firstName and Last name to lastName.

  8. Optional: in Group membership, select the groups, and enter groups as the app attribute.

  9. Turn on the app for the organizational units or the groups that can sign in to Magento.

Google Workspace setting Value
ACS URL ACS URL
Entity ID SP Entity ID
Name ID format EMAIL
Name ID Basic Information > Primary email
IdP metadata Download it when you create the app. Import this file in Magento.
Attribute name Source at Google Workspace Note
email Primary email Attribute mapping
firstName First name Attribute mapping
lastName Last name Attribute mapping
groups Group membership Optional

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

  1. Open the provider in Magento.

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

  3. In Attribute Mapping > Load Preset, select Google Workspace / Cloud Identity, 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.

Google sends the names of the groups. For the role rules, refer to Role mapping.

Google does not send how the user authenticated. Thus the two-factor authentication of Magento always applies.

Problem Solution
The login fails after you turn on the app. A change of the user access in Google can take some time. Wait, and try again.

For more problems, refer to Troubleshooting.