Google Workspace
This guide walks you through connecting Herd with Google Workspace, allowing your organization to sync users and groups for training and simulation management using your existing directory.
Google Workspace Overview
Herd allows organizations using Google Workspace as their Identity provider to sync users and groups for training and simulation assignment and management. Herd utilizes Google’s Admin SDK API through the Google Cloud Console.
Please Note: You’ll need to have administrator privileges in Google cloud and Google Workspace to complete this integration.
Step 1 – Create a Google Cloud project
Begin by creating a separate Google Cloud Project for this integration. This will allow for simple management and no conflicts with other Google Cloud integrations you may add in the future.
Open Your Google Cloud Console, as an administrator.
On the top toolbar, click the box that says, Select A Project.

On top left of the modal pop-up, select your organizations domain. Then select New project.
Name the project Herd Integration
Select your organization and location.
Select any location based on your preference.

Click the blue Create button.
Step 2 - Select the Project
Ensure you’ve selected the Herd project created in Step 1.
Select the box on the top toolbar with your organization name.
Select the project Herd Integration

You’ll be operating in this new project for the rest of the integration.
Step 3 – Enable the Admin SDK API
For this integration, we’ll utilize Google’s preexisting Admin SDK API.
Select the hamburger stack symbol, to the left of the Google Cloud logo, in the top toolbar.
Within the navigation, go to APIs & Services and select Enabled APIs & Services.
Select the + Enable APIs and services. At the top of the section. You’ll be taken to Google API Library

In the search box, type in Admin SDK API.
Once found, select Admin SDK API, then click Enable.

Step 4 – Create a Service Account
A dedicated service account, with domain-wide access, is needed to sync all group membership.
Check the top toolbar and ensure you’re within the Herd project
Select the hamburger icon to open the left side navigation, go to IAM & Admin and select Service Accounts.
Select + Create service account on the top toolbar

Enter a service account name, for example:
herd-integrationThen put a service account description For Herd Integration. The service account ID should automatically populate.Click Create and Continue.
Skip role and user access (leave defaults) and click Done.
This creates the dedicated identity Herd will use to access your domain data via APIs.
Step 5 - Save Service Account Details
You’ll need the new service account OAuth2 Client ID For Step 8
Copy and save the OAuth 2 Client ID. It is within the row that populated on the service account page and should be a 20-character string of numbers, for example:
234567890192872817
Step 6 - Grant IAM Permissions To Service Account
Select the hamburger logo on the top left, next to the Google Cloud logo.
Hover over IAM & Admin and select IAM.
On the top toolbar, select the Herd Integration project in the box right of the Google Cloud logo.
Switch to the Organization level, by select the Organization domain that the Herd Integration Project is within. This is likely your companies domain.

When the page updates, select the + Grant Access button
With the Add Principals box, add the email of the account you’re currently logged into as an administrator in the google cloud console. This is likely your generic organizational email. Example:
<user>@google.comUnder Assign Roles select the dropdown box and search for
Organization Policy Administrator. Once found, select it. Then Save.

Step 7 - Disable Legacy Service Key Creation Policy
By default, Google Cloud has an IAM policy that doesn’t allow the creation of JSON keys for service accounts, which is needed for the next step of this integration. We’ll need to disable this IAM policy.
On the top toolbar, select the box with your Herd project and go back to the your organization.
Select the hamburger logo, hover over IAM & Admin and select Organization Policies.
Scroll down slightly to the filter box above the table that lists all active and inactive policies. Copy and paste:
iam.disableServiceAccountKeyCreationand hit enter.Select the policy name Disable Service Account Key Creation, it’ll match the ID that we pasted above.
On the right, select the pencil icon with Manage Policy.
Select the radio button next to Inherit Parents Policy.
Click Set Policy.
The status should show “Not Enforced” in the box below.

Step 8 – Create and Download JSON Key
On the top toolbar, select the box with your organization and go back to the Herd Integration Project.

Select the hamburger icon on the top toolbar, and hover over IAM & Admin then select Service Accounts.
Select the Service Account created in Step 4.
On the next page, there will be multiple tabs. Select the one that says Keys.

Down the page, you’ll find a dropdown that says Add Keys. Select it and select Create New Key.
Select JSON, then click Create.
A JSON key file is downloaded to your computer.
Copy and save the key for use in the next step.
Treat this JSON file as a secret and store it securely. It grants API access when combined with domain-wide delegation.
Note: If you get an error that the organizational policy is blocking the service account key creation, go back and ensure that step 6 was performed properly.

Step 9 – Configure domain-wide delegation in the Admin console
Open a new tab in your browser and go to the Google Admin console as a super admin:
https://admin.google.comOn the left side toolbar, look for the Security dropdown. Note that it may be hiding under a “show more” button.
Select Security → Access and data control → API Controls.
On the bottom of the newly loaded page, look for the box named: Domain-wide Delegation. Select Manage Domain Wide Delegation.

You’ll be taken to a page titled API Clients. In the top toolbar, select Add New.
In Client ID, paste the Client ID of the
herd-integrationservice account that was created in Step 5.In OAuth scopes, enter the following scopes:
https://www.googleapis.com/auth/admin.directory.user.readonlyhttps://www.googleapis.com/auth/admin.directory.group.readonlyhttps://www.googleapis.com/auth/admin.directory.customer.readonly
Note: You’ll need to enter each row separately. Entering them on one line will not work.
Click Authorize.
These scopes grant read-only access to users, groups, and customer information, which is sufficient for Herd to discover and sync users and groups.
Step 10 – Connect Herd to Google Workspace
Open a new tab and login to your Herd Security admin console.
On the left side toolbar, select Administration.
Scroll down to the Google Workspace Integration section and select the dropdown arrow next to Google Workspace Configuration Settings.
Provide the following values:
Google Workspace Domain:
yourcompany.comAdmin Email: The Admin Email within the same domain that is a super admin within Google Workspace.
Service Account JSON Key: Paste the key that was created in Step 8

Select Save Google Workspace Configuration
Step 11 - Confirm User Sync
On the same page, select the Sync Google Workspace Users
If successful, a status box with the last time grouped sync will appear.

You can now successfully assign trainings to groups of users from your Google Workspace!
Last updated