Skip to main content

Google Workspace (formerly known as G Suite)

Setting Up Directory Sync

Create a service account

In order for Pomerium to validate group membership, we'll also need to configure a service account with G-suite domain-wide delegation enabled.

  1. Open the Service accounts page. If prompted, select a project.

  2. Click + Create Service Account, enter a name and description for the service account. You can use the default service account ID, or choose a different, unique one. When done click Create and continue.

  3. The next sections, labeled Grant this service account access to project and Grant users access to this service account, are not required. Click Continue to both, and then Create.

  4. Select your new service account, and click on the KEYS tab. Select Add key, then Create new key:

    Creating a new key for a Google service account

    In the side panel that appears, select the format for your key: JSON.

  5. Click Create. Your new public/private key pair is generated and downloaded to your machine; it serves as the only copy of this key. For information on how to store it securely, see Managing service account keys.

  6. Click Close on the Private key saved to your computer dialog, then click to return to the table of your service accounts.

Next, we need to enable enable G Suite domain-wide delegation:

  1. Locate the newly-created service account in the table. Under Actions, click Manage Details.

  2. In the service account details, click Advanced settings. Show domain-wide delegation, then ensure the Enable G Suite Domain-wide Delegation checkbox is checked.

    caution

    Domain-wide delegation may not be possible from here, depending on what type of Google account you have, as well as Google's updates to their interface. Consult their documentation on [Domain-Wide Delegation of Authority] as needed.

    If you haven't yet configured your app's OAuth consent screen, you must do so before you can enable domain-wide delegation. Follow the on-screen instructions to configure the OAuth consent screen, then repeat the above steps and re-check the checkbox.

  3. Click Save to update the service account, and return to the table of service accounts. A new column, Domain-wide delegation, can be seen. Click View Client ID, to obtain and make a note of the client ID.

Set directory permissions for Workspaces

Next, we need to give that service account permissionson the GSuite / Workspace side of the house.

  1. From your Google Workspace domain's Admin console Main menu, go to Security > Access and data control > API controls.

  2. In the Domain wide delegation pane, select Manage Domain Wide Delegation.

  3. Click Add new.

  4. In the Client ID field, enter the client ID obtained from the service account creation steps above.

  5. In the OAuth Scopes field, enter a comma-delimited list of the scopes required for your application (for a list of possible scopes, see Authorize requests).

    Include at a minimum the following list of scopes:

    • https://www.googleapis.com/auth/admin.directory.group.readonly
    • https://www.googleapis.com/auth/admin.directory.user.readonly
  6. Click the Authorize button.

Google create service account

Configure Pomerium Enterprise Console

Under Settings → Identity Providers, select "Google" as the identity provider and set the Impersonate User and JSON file.

Google Settings