Using the SAML 2.0 standard, you can configure single sign-on (SSO) for a number of cloud apps. After you set up SSO, your users can use their Google Workspace credentials to sign in to an app using SSO.
Use SAML to set up SSO for Office 365
You must be signed in as a super administrator for this task.Before you begin
- Add your Workspace domain to Microsoft Office 365. For instructions, go to Add a domain to Microsoft 365.
- Install PowerShell.
-
Configure ImmutableID—Office 365 uses the ImmutableID attribute to uniquely identify users. For SSO between Google and Office 365 to work, each Office 365 user must have an ImmutableID and the SAML Name ID attribute sent to Office 365 during SSO must be the same as the ImmutableID.
An Office 365 user's ImmutableID varies according to how the user is created. Here are the most likely scenarios:
- No users yet in Office 365—If you're going to set up Google to automatically provision users, you don't have to configure the ImmutableID attribute. It's mapped by default to the user's email address, the User Principle Name (UPN). Continue to Step 1.
-
If users were created in the Office 365 Admin console—ImmutableID should be blank. For these users, use the PowerShell Update-MgUser command to set the ImmutableID in Office 365 to match the user's UPN:
Update-MgUser -UserPrincipalName testuser@your-company.com -OnPremisesImmutableId testuser@your-company.com
You can also use Update-MgUser to bulk update all users. For the steps, go to the PowerShell documentation.
- If users were created via Microsoft Entra ID sync—ImmutableID is an encoded version of the Active Directory objectGUID. For these users:
- Use PowerShell to retrieve the ImmutableID from Entra ID. For example, to retrieve ImmutableID for all users and export to a CSV file:
$exportUsers = Get-MgUser -All | Select-Object UserprincipalName, OnPremisesImmutableId | Export-Csv C:csvfile
- Create a custom attribute in Google, then populate each user's profile with their Office 365 ImmutableID. For the steps, go to add a new custom attribute and update a user profile. You can also automate the process using GAM (an open source command line tool) or the Admin console APIs.
For more information on ImmutableID, go to the Microsoft documentation.
- Use PowerShell to retrieve the ImmutableID from Entra ID. For example, to retrieve ImmutableID for all users and export to a CSV file:
Step 1: Set up Google as a SAML identity provider
-
In the Google Admin console, go to Menu
Apps
Web and mobile apps.
You must be signed in as a super administrator for this task.
- Click Add app
Search for apps.
- For Enter app name, enter Office 365.
- In the search results, point to Microsoft Office 365 and click Select.
- In the Google Identity Provider details window, for Option 2: Copy the SSO URL, entity ID, and certificate:
- Next to SSO URL, click Copy
and save the URL.
- Next to Entity ID, click Copy
and save the entity ID.
- Next to Certificate, click Copy
and save the certificate.
You need these details to complete the setup in Office 365.
- Next to SSO URL, click Copy
Leave the Google Admin console open. You'll continue with the configuration in the Admin console after completing the setup steps in the app.
Step 2: Set up Office 365 as a SAML 2.0 service provider
- Open an Incognito browser window, go to the Office 365 sign-in page, and sign in with your Office 365 administrator account.
- Using a text editor, create PowerShell variables from the data you copied in Step 1. Here are the values needed for each variable:
* Ensure the $SigningCertifcate variable is on one line of text or PowerShell will return an error message.Variable Value $DomainName "your-company.com" $FederationBrandName "Google Cloud Identity" (or any value you choose) $Authentication "Federated" $PassiveLogOnUrl
$ActiveLogOnUri"SSO URL" (from Step 1) $SigningCertificate "Paste complete certificate here" (from Step 1)* $IssuerURI "Entity ID" (from Step 1) $LogOffUri "https://accounts.google.com/logout" $PreferredAuthenticationProtocol "SAMLP" - Using the PowerShell console, run the Update-MgDomain command to configure your Active Directory domain for federation. For the steps, go to the Microsoft PowerShell documentation.
- (Optional) To test federation settings, use the following PowerShell command:
Get-MgDomainFederationConfiguration -DomainName your-company.com | Format-List *
Note: If your domain is already federated and you need to change federation to Google, run the following command using the same parameters listed in the table above:
Update-MgDomainFederationConfiguration
Step 3: Finish SSO configuration in Admin console
- Return to the Admin console browser tab.
- Click Continue.
- On the Service provider details page:
- Check the Signed response box.
- For Name ID format, select Persistent.
- For Name ID, choose an option:
- If you created a custom attribute to add the Office 365 ImmutableID to your users' profiles, select the custom attribute.
- If you didn't create a custom ImmutableID attribute, select Basic Information
Primary email.
- Click Continue.
- On the Attribute mapping page, click Select field and map the following Google directory attributes to their corresponding Office 365 attributes. The IDPEmail attribute is required.
Google Directory attribute Office 365 attribute Basic Information > Primary Email IDPEmail* - (Optional) To add additional mappings, click Add Mapping and select the fields that you need to map.
-
(Optional) To enter group names that are relevant for this app:
- For Group membership (optional), click Search for a group, enter one or more letters of the group name, and select the group name.
- Add additional groups as needed (maximum of 75 groups).
- For App attribute, enter the corresponding groups attribute name of the service provider.
Regardless of how many group names you enter, the SAML response includes only groups that a user is a member of (directly or indirectly). For more information, go to About group membership mapping.
- Click Finish.
Step 4: Turn on app for users
-
In the Google Admin console, go to Menu
Apps
Web and mobile apps.
You must be signed in as a super administrator for this task.
- Click Office 365.
-
Click User access.
-
To turn a service on or off for everyone in your organization, click On for everyone or Off for everyone, and then click Save.
-
(Optional) To turn a service on or off for an organizational unit:
- At the left, select the organizational unit.
- To change the Service status, select On or Off.
- Choose one:
- If the Service status is set to Inherited and you want to keep the updated setting, even if the parent setting changes, click Override.
- If the Service status is set to Overridden, either click Inherit to revert to the same setting as its parent, or click Save to keep the new setting, even if the parent setting changes.
Learn more about organizational structure.
-
(Optional) To turn on a service for a set of users across or within organizational units, select an access group. For details, go to Customize service access using access groups.
- Ensure that your Office 365 user account email domains match the primary domain of your organization's managed Google account.
Step 5: Verify SSO is working
Office 365 supports both identity provider-initiated and service provider-initiated SSO.
Verify identity provider-initiated SSO
-
In the Google Admin console, go to Menu
Apps
Web and mobile apps.
You must be signed in as a super administrator for this task.
- Click Office 365.
- In the Office 365 section, click Test SAML login.
The app should open in a separate tab. If it doesn't, troubleshoot the error message and try again. For details on troubleshooting, go to SAML app error messages.
Verify service provider-initiated SSO
- Close all browser windows.
- Go to the Office 365 sign-in page and sign in with your Office 365 administrator account.
You should be automatically redirected to the Google sign-in page. - Select your account and enter your password.
After your credentials are authenticated, the app should open.
Step 6: Set up user provisioning
As a super administrator, you can automatically provision users in the app. For details, go to Configure Office 365 user provisioning.
Google, Google Workspace, and related marks and logos are trademarks of Google LLC. All other company and product names are trademarks of the companies with which they are associated.