Google Workspace verification uses a service account with domain-wide delegation to query the Google Admin SDK Directory API, which SecurityGateway uses to look up and verify unknown local addresses. Optionally, you can also configure an OAuth client to let your Google Workspace users sign in to SecurityGateway directly with their Google account, similar to the Microsoft 365 sign-in experience described above.
To use Google Workspace as a user verification source, SecurityGateway requires a Google Cloud service account that has been granted domain-wide delegation to read your Workspace directory. Follow the steps below to configure Google Workspace as a user verification source in SecurityGateway.
In Google Cloud Console:
Create a project and enable the Admin SDK API in Google Cloud Console
1.Sign in to the Google Cloud Console and create or select the project that will own the service account.
2.Go to APIs & Services > Library, search for Admin SDK API, open it, and click Enable.

|
This step is easy to miss, since everything else in this setup will appear to work without it...the service account can still obtain a token, and the Test button on the User Verification Source screen will still pass. Directory lookups only fail once SecurityGateway actually tries to verify a real address, at which point you'll see a 403 error. If verification is failing after everything else looks correctly configured, confirm this API is enabled.
|
Create a service account and JSON key
1.Go to IAM & Admin > Service Accounts and click Create Service Account. Give it a name (for example, "securitygateway-uvs"). No Google Cloud IAM roles need to be assigned; the access this account needs is granted through domain-wide delegation in the next step, not through IAM.
2.Open the new service account, go to the Keys tab, and click Add Key > Create new key, choosing JSON. This downloads a JSON key file. Keep this file safe, and be aware that Google will not let you download it again once you close the dialog. Otherwise, you would need to generate a new key instead.
3.While you're on the service account's details, make a note of its numeric Client ID (labeled "Unique ID"). You'll need it in the next step. Be careful not to confuse it with the Google Cloud project ID, the service account's email address, its display name, or the separate OAuth Client ID you may create later for web login — these are all different values.
Authorize domain-wide delegation in the Google Workspace Admin Console
1.Sign in to the Google Workspace Admin Console as a super administrator.
2.Go to Security > Access and data control > API controls > Domain-wide delegation, and click Add new.
3.For Client ID, enter the service account's numeric Client ID from Step 3 above.
4.For OAuth scopes, enter the following scope, then click Authorize:
https://www.googleapis.com/auth/admin.directory.user.readonly
(Optional) Enable Google sign-in for the SecurityGateway web interface
If you also want your Google Workspace users to be able to sign in to SecurityGateway with their Google account instead of a SecurityGateway password, create a separate OAuth client:
1.In Google Cloud Console, go to APIs & Services > Credentials, click Create Credentials > OAuth client ID, and choose Web application.
2.Add an authorized redirect URI that exactly matches your SecurityGateway login URL with /auth appended (e.g. https://sg.example.com/auth).
3.Make a note of the generated Client ID and Client Secret.
This OAuth client is separate from the service account above. The service account is only ever used for directory lookups, and the OAuth client is only ever used for interactive sign-in.
Choose the admin account to impersonate:
Domain-wide delegation always acts as a specific Workspace user, and looking up directory users requires Google Workspace admin privileges. Choose a super administrator account, or an account with a custom admin role that includes the "Users > Read" privilege. You'll enter this address in SecurityGateway as the Admin Email field below.
In SecurityGateway:
1.Login to SecurityGateway as a global admin.
2.Click Setup/Users.
3.Select Accounts.
4.Select User Verification Sources.
5.Click New.
6.Select Google Workspace as the Type.
7.Enter a description.
8.Enter your Google Workspace primary domain in the Domain Name field.
9.In the Admin Email field, enter the email address of the Google Workspace administrator you chose to impersonate.
10.Paste the full contents of the service account JSON key file into the Service Account Key (JSON) field.
11.If you set up Google sign-in above, enter the OAuth Client ID and OAuth Client Secret. Otherwise, leave these blank.
12.Click Save and Close.
Description:
Use this text box for a description of the verification source (for example, "Server X at example.com"). It corresponds to the Description column on the User Verification Sources page.
Domain Name
Enter your organization's Google Workspace primary domain name (e.g. example.com). This does not need a host name or port; SecurityGateway always connects to Google's own API endpoints for Google Workspace lookups. If you've also configured Google sign-in, this domain is additionally used to confirm that anyone signing in belongs to your Workspace, rejecting sign-in attempts from Google accounts outside it.
Admin Email
Enter the email address of the Google Workspace administrator account for the service account to impersonate. Google's Directory API requires that lookups be performed on behalf of an actual admin user via domain-wide delegation, so this must be an existing account in your Workspace directory with administrative rights to read the directory (a super administrator, or an account with a custom role that includes "Users > Read") — not the service account itself. NOTE: If the Google Workspace account entered in Admin Email is ever suspended, deleted, or has its administrator role removed, Google Workspace verification will start failing for every domain using this source, even though nothing changed in SecurityGateway.
Service Account Key (JSON)
Paste the entire contents of the JSON key file you downloaded for the service account in Google Cloud Console. SecurityGateway uses this key to sign requests to the Directory API on behalf of the Admin Email account above. If you ever need to revoke and replace this key, generate a new one in Google Cloud Console and paste its contents here to replace the old value.
OAuth Client ID (Optional)
The Client ID of a Google Cloud OAuth client (of type "Web application"), used only to let users at this domain sign in to the SecurityGateway web interface with their Google Workspace account, instead of a SecurityGateway password. Leave this blank if you only want Google Workspace used to verify addresses, without offering Google sign-in.
OAuth Client Secret (Optional)
The Client Secret that corresponds to the OAuth Client ID above. Both the Client ID and Client Secret must be set together for Google sign-in to be offered to users at this domain — if either is left blank, users will continue signing in with a SecurityGateway password.

|
Like the LDAP option above, Google Workspace does not support dynamic password authentication. If you require your users to authenticate with a password (for example, to send outbound mail or use an email client that only supports basic authentication) and you have not configured the optional OAuth Client ID/Secret described above, those users will need a SecurityGateway account password.
|
|