Skip to main content

Google Workspace (previously G Suite)

About 3 min

Google Workspace Configuration

This session shows how to create an OAuth 2.0 Client ID, service account and set permissions in Google Workspace (previously G Suite).

1. Create a new OAuth consent screen:
Select OAuth consent screen and select Internal, then Click CREATE: Google Workspace SSO | Google Workspace Create OAuth consent screen Supply the App name, User support email and Developer contact information and click SAVE AND CONTINUE. Google Workspace SSO | Google Workspace Create OAuth consent screen
Google Workspace SSO | Google Workspace Create OAuth consent screen
Keep default settings and click SAVE AND CONTINUE: Google Workspace SSO | Google Workspace Create OAuth consent screen Check the Summary and click BACK TO DASHBOARD -- an OAuth consent screens should be displayed: Google Workspace SSO | Google Workspace Create OAuth consent screen

Create and Configure your OAuth 2.0 Client ID

2. Create a Credential:
Select Credentials tab and click CREATE CREDENTIALS, then select OAuth client ID:
Google Workspace SSO | Google Workspace Credential Config
Select Web application as Application type. Add Authorized redirect URIs, e.g., http://localhost:9772/datawiza/authorization-code/callback and click Create: Google Workspace SSO | Google Workspace Credential Config Make sure you save the Client ID and Client Secret. You'll need to enter these values when configuring our IdP in Datawiza Cloud Management Console at latter steps. Google Workspace SSO | Google Workspace Credential Config

Create a Service Account

In order to have DAP validate group membership, we'll also need to configure a service accountopen in new window with Google Workspace domain-wide delegationopen in new window enabled.

Go to Google Cloud Platform API & Servicesopen in new window, select Credentials tab. Then click CREATE CREDENTIALS, select Service account: Google Workspace SSO | create service account Input the service account name then click DONE: Google Workspace SSO | create service account Click the service account we created, select KEYS tab. Click ADD KEY->Create new key: Google Workspace SSO | create service account Select JSON as Key type, click CREATE: Google Workspace SSO | create service account Then the private key will saved to your computer. Close the dialog and go back to the DETAILS tab. Click the Advanced settings, note down the Client ID, then click VIEW GOOGLE WORKSPACE ADMIN CONSOLE. Google Workspace SSO | create service account

Set Directory Permissions

In the Google Workspace admin console, select Security->Access and data control->API controls: Google Workspace SSO | google workspace

Click MANAGE DOMAIN WIDE DELEGATIONGoogle Workspace SSO | google workspace

Click Add new.
For the Client ID field, input the Client ID we noted down from the service account creation step above. For the OAuth Scopes field, input the following scopes: https://www.googleapis.com/auth/admin.directory.group.readonly
https://www.googleapis.com/auth/admin.directory.user.readonly
Click AUTHORIZE: Google Workspace SSO | google workspace

Set the Impersonate User

Create or choose an existing administrative email address as the impersonating user. This email will be impersonated by this client to make calls to the Admin SDK. You can see hereopen in new window for more information.

Or basically, create a specific user with user and group read privileges: Go to Directory -> Users, click Add new user: Google Workspace SSO | impersonate userGoogle Workspace SSO | impersonate user Input basic info and click ADD NEW USER: Google Workspace SSO | impersonate user

Go To Account -> Admin roles, click Create new role: Google Workspace SSO | impersonate userGoogle Workspace SSO | impersonate user Input name and click CONTINUE: Google Workspace SSO | impersonate user For Admin API Privileges, select Read under Users and Groups, click CONTINUE: Google Workspace SSO | impersonate userGoogle Workspace SSO | impersonate user Review privileges and click CREATE ROLE: Google Workspace SSO | impersonate user Click Assign users: Google Workspace SSO | impersonate user Select the user we just created and click ASSIGN ROLE: Google Workspace SSO | impersonate user

Enable Admin SDK API

Select Enabled APIs & services then click ENABLE APIS AND SERVICES: Google Workspace SSO | Google Workspace API Search for Admin SDK API and click: Google Workspace SSO | Google Workspace API Enable the API: Google Workspace SSO | Google Workspace API

Summary

We have shown how to create a service account and set permissions for Google Workspace. Please make sure to save the following values for later setting in Datawiza Cloud Management Console.

  • Service Account Credentials (including both Client ID and Client Secret)
  • Impersonate User

Reference

Perform Google Workspace Domain-Wide Delegation of Authorityopen in new window
Use your Admin consoleopen in new window