Office 365 cloud application

Using Security Assertion Markup Language (SAML), your users can use their Google Cloud credentials to sign in to enterprise-cloud applications.

Set up SSO via SAML for Microsoft Office 365

Here's how to set up single sign-on (SSO) via SAML for the Microsoft Office 365 application.

Before you begin
Step 1: 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 set up Google to autoprovision users, you don’t have to configure ImmutableID, it is mapped by default to the user’s email address (the User Principle Name or UPN). Continue to Step 2 below.
  • If users were created in Office 365 Admin console, ImmutableID should be blank. For these users, use the PowerShell Set-MsolUser command to set the ImmutableID in Office 365 to match the user’s UPN: 

    Set-MsolUser -UserPrincipalName testuser@yourdomain.com -ImmutableId testuser@yourdomain.com

    You can also use Set-MsolUser to bulk update all users. Refer to the PowerShell documentation for specific instructions.

  • If users were created via Azure Active Directory sync, ImmutableID is an encoded version of the Active Directory objectGUID. For these users:
    1. Use PowerShell to retrieve the ImmutableID from Azure AD. For example, to retrieve ImmutableID for all users and export to a CSV file:

      $exportUsers = Get-MsolUser -All | Select-Object UserprincipalName, ImmutableID | Export-Csv C:\csvfile

    2. Create a custom attribute in Google, then populate each user’s profile with their Office 365 ImmutableID. For instructions see 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 Workspace Admin SDK.

For more information on ImmutableID, see Microsoft documentation.

Step 2: Get Google identity provider (IdP) information
  1. Sign in to your Google Admin console.

    Sign in using an account with super administrator privileges (does not end in @gmail.com).

  2. From the Admin console Home page, go to Securityand thenSet up single sign-on (SSO) for SAML applications.

    You must be signed in as a super administrator for this task.

  3. In the Set up single sign-on (SSO) section, copy and save the SSO URL and Entity ID, and download the Certificate.

Next you'll switch to Office 365 to do the setup steps in Step 3. You'll return to the Admin console in Step 4 below to finish SSO configuration.

Step 3: Set up Office 365 as a SAML 2.0 service provider (SP)
  1. In a new browser tab, log into your Office 365 application as an administrator.
  2. Using a text editor, create PowerShell variables from the IdP data you copied from Google. Here are the values needed for each variable:
    Variable Value
    $DomainName yourdomain.com”
    $FederationBrandName “Google Cloud Identity” (or any value you choose)
    $Authentication “Federated”
    $PassiveLogOnUrl
    $ActiveLogOnUri 
    “SSO URL” (from Google IdP information)
    $SigningCertificate “Paste complete certificate here” (from Google IdP information)*
    $IssuerURI “Entity ID” (from Google IdP information)
    $LogOffUri “https://accounts.google.com/logout”
    $PreferredAuthenticationProtocol “SAMLP”
    *Ensure the $SigningCertifcate variable is on one line of text, or PowerShell will return an error message.
  3. Using the PowerShell console, run the Set-MsolDomainAuthentication command to configure your Active Directory domain for federation. Refer to the Microsoft PowerShell documentation for specific instructions.
  4. (Optional) To test federation settings, use the following PowerShell command: 

    Get-MSolDomainFederationSettings -DomainName yourdomain.com | Format-List *

Note: If your domain is already federated and you need to change federation to Google, run the
Set-MsolDomainFederationSettings command, using the same parameters listed in the table above.

Step 4: Set up Google as a SAML identity provider (IdP)
  1. Sign in to your Google Admin console.

    Sign in using an account with super administrator privileges (does not end in @gmail.com).

  2. From the Admin console Home page, go to Appsand thenWeb and mobile apps.
  3. Click Add appand thenSearch for apps.
  4. Enter Office 365 in the search field.
  5. In the search results, hover over the Office 365 SAML app and click Select.
  6. On the Google Identity Provider details page, click Continue.
  7. On the Service provider details page:
    1. Check Signed response.
    2. Set the Name ID format to "PERSISTENT”.
    3. If you created a custom attribute to add the Office 365 Immutable ID to your Google users' profiles (see Step 1 above), select the custom attribute as Name ID. Otherwise set Name ID to Basic Information > Primary email.
  8. Click Continue.
  9. On the Attribute mapping page, click the Select field menu and map the following Google directory attributes to their corresponding Office 365 attributes:
     
    Google Directory attribute Office 365 attribute
    Basic Information > Primary Email IDPEmail
  10. (Optional) If you want to send a user’s group membership information in the SAML response, enter the group names that are relevant for this app in the Group membership field.

    This feature is currently in beta and not yet available to all customers.

    1. Under Google groups, click in the Add group entry field.
    2. Type one or more letters of the group name.
    3. Choose the group name from the dropdown menu.
    4. Add additional groups as needed (total groups cannot exceed 75).
    5. Under [app name] attribute, enter the service provider’s corresponding groups attribute name.

    Note: Regardless of how many group names you enter, the SAML response will only include groups that a user is a member of (directly or indirectly). For more information, see About group membership mapping.

  11. Click Finish.
Step 5: Enable the Office 365 app
  1. Sign in to your Google Admin console.

    Sign in using an account with super administrator privileges (does not end in @gmail.com).

  2. From the Admin console Home page, go to Appsand thenWeb and mobile apps.
  3. Select Office 365.
  4. Click User access.
  5. To turn on or off a service for everyone in your organization, click On for everyone or Off for everyone, and then click Save.

  6. (Optional) To turn a service on or off for an organizational unit:

    1. At the left, select the organizational unit.
    2. Select On or Off.
    3. Click Override to keep your setting if the service for the parent organizational unit is changed.
    4. If Overridden is already set for the organizational unit, choose an option:
      • Inherit—Reverts to the same setting as its parent.
      • Save—Saves your new setting (even if the parent setting changes).

    Learn more about organizational structure.

  7. (Optional) Turn on the service for a group of users.
    Use access groups to turn on a service for specific users within or across your organizational units. Learn more

  8. Ensure that your Office 365 user account email IDs match those in your Google domain.
Step 6: Verify that the SSO is working between Google and Office 365

Office 365 supports both Identity Provider (IdP) initiated and Service Provider (SP) initiated SSO. Follow these steps to verify SSO in either mode:

IdP-initiated

  1. Sign in to your Google Admin console.

    Sign in using an account with super administrator privileges (does not end in @gmail.com).

  2. From the Admin console Home page, go to Appsand thenWeb and mobile apps.
  3. Select Office 365.
  4. At the top left, click Test SAML login

    Office 365 should open in a separate tab. If it doesn’t, use the information in the resulting SAML error messages to update your IdP and SP settings as needed, then retest SAML login.

SP-initiated

  1. Open https://login.microsoftonline.com/.
    You should be automatically redirected to the Google sign in page.
  2. Enter your sign in credentials.
  3. After your sign in credentials are authenticated you will be automatically redirected back to Office 365.
Step 7: Set up auto-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.

Was this helpful?
How can we improve it?
true
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
false