Google Workspace
Connect Google Workspace to Workforce Authority so your users sign in with their Google accounts, and Workforce Authority adds MFA and risk-based policies on top.
You set up two connections:
- Directory sync. Workforce Authority reads users and groups from Google Workspace, so policies and applications can target Google groups and user profiles stay current.
- SAML sign-in. Users enter their Google password at Google, and Workforce Authority federates to Google over SAML 2.0 before it applies MFA.
Sign-in works without directory sync. Add the directory when you want to target policies at Google groups or keep profile attributes in step with Google. Without it, your users stay in the Workforce Authority Directory, which needs one setting changed before they can enroll in MFA: see Part 3.
Why SAML, not OpenID Connect
Google blocks its OAuth 2.0 sign-in page inside embedded browsers, such as the in-app browser of Microsoft Teams and other client apps, and answers with a disallowed_useragent error. If Workforce Authority federated to Google over OpenID Connect, a user who opens a protected application from one of those apps could not sign in. SAML sign-in reaches Google at an endpoint that policy does not cover, so it works in the same in-app browsers. Use SAML for Google Workspace.
Before you begin
- A Google Workspace super administrator account. Custom SAML apps and domain-wide delegation need one.
- A Google Cloud project you can create a service account in.
- An administrator account in Workforce Authority.
- Matching identities: Workforce Authority finds the signed-in user by the email Google sends. With the directory from Part 1, each user's Workforce Authority username must also be their Google primary email or one of its aliases, because Workforce Authority looks the username up in Google.
Don't also set up the Google Workspace SAML integration for the same users. That guide makes Workforce Authority the identity provider for Google, and this one makes Google the identity provider for Workforce Authority: together they send each sign-in back and forth between the two.
Part 1: Connect the directory
Create a service account
Do this in the Google Cloud console. For details, see Google's guide to creating a service account.
-
Select the project, or create one.
-
Go to APIs & Services > Library, open Admin SDK API, and click Enable.
-
Go to IAM & Admin > Service Accounts and click Create service account. Give it a name you will recognize, such as Workforce Authority directory. It needs no project roles.
-
Open the service account, select the Keys tab, and click Add key > Create new key. Choose JSON and click Create.
Your browser downloads the key file. Store it securely: Google cannot download it again, and anyone holding it can read your directory.
-
Open the key file and copy the value of
client_id. You need it in the next step.
Grant domain-wide delegation
Domain-wide delegation lets the service account read your directory as one of your administrators. Do this in the Google Admin console. For details, see Google's guide to domain-wide delegation.
-
Go to Security > Access and data control > API controls.
-
Click Manage Domain Wide Delegation, then Add new.
-
In Client ID, paste the
client_idfrom the key file. -
In OAuth scopes, paste all four scopes below, commas included:
https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/admin.directory.domain.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.userschema.readonly -
Click Authorize.
Every scope is read-only. Workforce Authority never changes anything in Google Workspace.
| Scope | What Workforce Authority reads |
|---|---|
admin.directory.user.readonly |
Users, their profiles and photos |
admin.directory.domain.readonly |
Your domains |
admin.directory.group.readonly |
Groups and their members |
admin.directory.userschema.readonly |
Custom attributes, so you can map them |
Add the directory in Workforce Authority
-
In Workforce Authority, go to User Directories and click Create New Directory.
-
Choose Google Workspace.
-
Enter a Name for the connection, and select your Google Workspace domains under Domains.
-
Under Google Workspace Directory Settings, set the following:
Customer ID Optional. Your Google account's customer ID, found in the Admin console under Account > Account settings. With it, group searches cover every domain in your account. Domain Name Your primary Google Workspace domain, such as example.com. Required when you leave Customer ID empty; group searches then cover this domain only.Admin Email The Google Workspace administrator the service account acts as. Pick an administrator who can read users, groups and domains. Without domain read, applications get no groups for users whose email is outside your domains. If this account is suspended or loses its admin role, sign-in fails for every user in the directory's domains. User Identifier Attribute Leave it empty, so Workforce Authority matches users by primary_email. Another attribute makes Workforce Authority create a second account for users it already has.Service Account JSON Paste the whole contents of the key file. 
-
Under Attribute Mappings, map Google attributes to Workforce Authority user attributes. A typical starting point:
Directory attribute User schema attribute name.given_namefirst_namename.family_namelast_namephones[0].valuemobile_phone_numberFor list attributes such as
organizations,emailsorphones, pick one entry by its position, such asorganizations[0].department. -
Under Basic Configuration, choose the behavior you want:
Attribute Synchronization Copies the mapped attributes from Google into Workforce Authority. Inline User Provisioning Creates a user in Workforce Authority the first time they authenticate through this directory. Inline Factor Provisioning Prompts users to set up authentication factors during sign-in. Search Directory for Groups Checks Google group membership for users who sign in through another directory, so policies and applications that target Google groups apply to them too. -
Click Save.
Part 2: Set up SAML sign-in
You move between two consoles here. Google shows its own sign-in details first and asks for Workforce Authority's at the end, and Workforce Authority shows its details only after you save the federated client. Keep the Google tab open while you work in Workforce Authority.
Start the SAML app in Google
For details, see Google's guide to setting up a custom SAML app.
-
In the Google Admin console, go to Apps > Web and mobile apps.
-
Click Add app > Add custom SAML app.
-
Enter an app name, such as Workforce Authority, and click Continue.
-
On Google Identity Provider details, click Download Metadata to save the IdP metadata file.
Leave this page open. You come back to it after the next two steps.
Add Google as a SAML provider
-
In Workforce Authority, go to External IdPs > Providers.
-
Click Create New Provider and choose SAML.
-
Paste the contents of the metadata file into IdP Metadata XML and click Read metadata.
Workforce Authority fills in Entity ID, Sign-On URL and Signing Certificates from it. Google's Entity ID looks like
https://accounts.google.com/o/saml2?idpid=C0abc123. -
Enter a Name, such as
Google Workspace, check the filled-in values, and click Save.
Without the metadata file, copy SSO URL, Entity ID and Certificate from Google's page into Sign-On URL, Entity ID and Signing Certificates instead.
Create the federated client
-
Go to External IdPs > Federated Clients and click Create New Client.
-
Set the following:
Identity Provider The SAML provider you just added, such as Google Workspace. Name The label on the sign-in button, such as Sign in with Google. Users see it when sign-in doesn't go straight to Google.NameID Format Email Address. Attribute Mapping Leave Email empty: Workforce Authority then reads the email from the NameID. To fill in names and roles, enter first_namefor First Name,last_namefor Last Name, andgroupsfor Groups. These must match the app attribute names you enter in Google. Names apply only with User Profile Synchronization on.Enabled On. Auto Provision User On to create a Workforce Authority user, named by their email, the first time someone signs in. Off to let only existing users sign in. User Profile Synchronization On to update first and last name from Google at every sign-in. User Role Synchronization On to assign roles from Google groups. See Map Google groups to roles. -
Click Save, then open the client again.
-
Copy Assertion Consumer Service (ACS) URL and Service Provider (SP) Entity ID. They look like this:
ACS URL https://sso.example.com/example-corp/federation/saml/acsSP Entity ID https://sso.example.com/example-corp/saml/federation
Finish the SAML app in Google
-
Return to the Google tab and click Continue.
-
On Service provider details, set the following, then click Continue:
ACS URL The Assertion Consumer Service (ACS) URL you copied. Entity ID The Service Provider (SP) Entity ID you copied. Start URL Leave empty. Signed response Leave unchecked. Google then signs the assertion itself, which Workforce Authority requires. Name ID format EMAIL. Name ID Basic Information > Primary email. -
On Attribute mapping, add the attributes you mapped in the federated client:
Google Directory attributes App attributes Basic Information > First name first_nameBasic Information > Last name last_nameFor roles, also search for the groups under Group membership, select them, and enter
groupsas the app attribute. -
Click Finish.
Turn on the app for your users
A new SAML app is off for everyone.
-
In Apps > Web and mobile apps, open the app and click User access.
-
Turn the service on for everyone, or for the organizational units or groups that should sign in through Workforce Authority, and click Save.
Google can take up to 24 hours to apply the change, though it usually takes minutes.
Map Google groups to roles
With User Role Synchronization on and Groups mapped, Workforce Authority sets a user's roles from Google at every sign-in:
- Google sends the names of the groups you selected in Group membership that the user belongs to, directly or through a group nested inside one of them. It sends at most 75.
- Workforce Authority assigns each role whose name exactly matches a group name, and removes the roles Google didn't send. The default user role stays.
- The built-in roles count too. Organization Admin, Help Desk and Messaging API match groups named
org_admin,help_deskandmessaging_api. Before you turn sync on, select a Google group namedorg_adminthat holds your administrators. Otherwise they lose Organization Admin at their next sign-in. - Create a role in Workforce Authority for each other Google group you select, with exactly the group's name.
- When you rename a Google group, select it again under Group membership, or Google keeps sending the old name.
With User Role Synchronization on, anyone who can change the selected groups in Google can grant roles in Workforce Authority, Organization Admin included. Global User Role Synchronization (Super Admin, Admin), where your console offers it, extends that to server administrator roles. Turn either on only if group changes in Google are tightly controlled.
Part 3: Check MFA enrollment
New organizations come with an enabled policy, User enrollment mobile pairing, that has each new user pair the Workforce Authority Mobile app at their first sign-in.
Pairing at sign-in needs Inline Factor Provisioning on the directory that holds the user. The Google Workspace directory from Part 1 has it on by default. If you skipped Part 1, open the Workforce Authority Directory under User Directories and turn on Inline Factor Provisioning in its Basic Configuration. Otherwise every new user's first sign-in fails.
If the policy is off or was deleted, create one:
-
In Workforce Authority, go to Policies and click Create New Policy.
-
Set the following:
Name Enter Force Device Pairing. Event Set to Enrollment. Applications Select the Apply to All Applications check box. When Select Add condition, then Always. Action Select the Require Device Pairing radio button. 
-
Save the policy.
Part 4: Test sign-in
Test before Part 5 turns on required federation, so your other sign-in options still work if something is wrong. Use a test user who has access to the SAML app in Google.
-
Open your tenant's SSO URL. It is the ACS URL without
/federation/saml/acs: forhttps://sso.example.com/example-corp/federation/saml/acs, openhttps://sso.example.com/example-corp. -
Click the button named after your federated client, such as Sign in with Google.
-
Sign in at Google.
-
Workforce Authority takes over: on first sign-in it walks the user through pairing the Workforce Authority Mobile app, then signs them in.
Users follow the same flow for every SAML and OIDC application that signs in through Workforce Authority SSO.
Don't test with Google's Test SAML login button. It starts the sign-in at Google, which Workforce Authority does not accept, so it fails even when everything is set up correctly. Always start from Workforce Authority.
Part 5: Send all sign-in to Google
-
In Workforce Authority, go to Settings.
-
In the SSO section, turn on Require federation for sso.

-
Save your settings.
With one enabled federated client, the SSO sign-in page now sends users straight to Google. While this setting is on, Workforce Authority won't let you disable the last enabled federated client.
To show Google first but keep other sign-in options, leave the setting off and set Default idp login screen to Federation instead.
Rotate Google's signing certificate
Google's SAML certificates last five years. Workforce Authority rejects assertions signed with an expired certificate, so sign-in stops the day it expires. Rotate it before then, keeping both certificates valid during the switch:
-
In the Google Admin console, add a second certificate. See Google's guide to maintaining SAML certificates.
-
In Workforce Authority, go to External IdPs > Providers, open the Google provider, click Add certificate, paste the new certificate, and save. Workforce Authority now accepts both.
-
In Google, switch the SAML app to the new certificate. Google can take up to 24 hours to apply it.
-
Once sign-in works with the new certificate, remove the old one from the provider in Workforce Authority.
-
Google's certificates are shared by every custom SAML app in your account. Delete the old one in Google only after each app uses the new one: an app left on a deleted certificate stops signing users in.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| Sign-in fails before Google's sign-in page opens | Enable saml federation is off. In Settings, in the Features section, turn it on. |
Google shows app_not_configured or app_not_configured_for_user |
The app's Entity ID doesn't match the federated client's Service Provider (SP) Entity ID. The match is case-sensitive. |
Google shows app_not_enabled_for_user |
The SAML app is off for this user, or the change hasn't reached Google yet. Turn it on under User access and wait. |
| Google says the ACS URL in the request doesn't match | Copy the federated client's Assertion Consumer Service (ACS) URL into the app's ACS URL again. |
Google shows saml_invalid_user_id_mapping |
Set the app's Name ID format to EMAIL, matching Email Address in the federated client. |
| Google's Test SAML login fails | Expected. Test from your Workforce Authority SSO URL instead. |
| Google signs the user in, then Workforce Authority shows an error | Workforce Authority rejected the assertion. Check that Signed response is unchecked in the app, so Google signs the assertion, and that the provider holds Google's current, unexpired certificate. |
| A user who signs in for the first time is refused | The user doesn't exist in Workforce Authority and Auto Provision User is off. Turn it on, or create the user with their Google primary email. |
| A user is refused although they exist in Workforce Authority | With the directory on, their Workforce Authority username isn't a Google address. Change it to their Google primary email. |
| A new user's first sign-in fails at device pairing | Inline Factor Provisioning is off on the user's directory. See Part 3. |
| Roles don't change | Check that User Role Synchronization is on, Groups is mapped to groups, the group is selected under Group membership in Google, and the role's name matches the group's exactly. |
| The directory reports an error after saving, or sign-in fails for everyone in its domains | Check that the Admin SDK API is enabled, that the delegation's client ID and all four scopes match, and that Admin Email names an active administrator. Delegation changes can take a while to reach Google. |
| Google won't create a JSON key | Your Google Cloud organization blocks service account keys. Ask your organization policy administrator to allow key creation for this project. |