Firstly, we need to obtain credentials such as
Client IDClient secretAdmin email(optionally)Service account key(optionally)
If you already have them, please skip to Configuring Google as external OIDC in Defguard
Obtaining basic credentials
Here is full Google documentation about this process.
The Google OpenID Connect can be configured in the Google Cloud Console
If you don't have any project setup already (or you want to create a new one for this purpose), create it by clicking the dropdown menu here:

If you already have project, make sure to select it in the above dropdown menu.
Now, navigate to
APIs & ServicesWe will focus on the consent screen first, select
OAuth consent screenPick the User Type according to your needs, this example will focus on the internal type

Fill in all required details. Make sure to fill the correct domain. This should be the top domain under which your Defguard dashboard can be accessed, not the subdomain (e.g.
defguard.example.com->example.com)On the scopes config screen, click
ADD OR REMOVE SCOPES, Defguard requires at least the following scopes:
Proceed until the end and return to the OAuth consent screen dashboard.
Now, go to
Credentials, clickCREATE CREDENTIALSand chooseOAuth client ID
On the next screen, fill out all required information:

Make sure to select "Web application" as the application type. The other thing to note here is the redirect URI. It is the URI to which the user will be redirected from the external provider's authorization. This URI is in the form of
<DEFGUARD_URL>/auth/callback. Replace<DEFGUARD_URL>with the URL under which your dashboard is accessible, e.g.,https://defguard.example.com. If you'd like to use OpenID enrollment through proxy (and MFA, make sure to enter an additional URIs here in the form of<DEFGUARD_PUBLIC_URL>/openid/callback, and if you use External MFA please add also:<DEFGUARD_PUBLIC_URL>/openid/mfa/callbackAfter you proceed further, you will be presented with a popup containing your
Client IDandClient Secret, copy them as you will need them in Defguard
Obtaining Directory Synchronization credentials
Navigate to Service Accounts in the Google Cloud console

Click "Create service account"
Give your service account a descriptive name

Skip step 2 and 3 if you are not sure what to configure there
Go to your newly created service account and add a new key in the "KEYS" tab

A JSON file will be downloaded after you click "CREATE". Store it securely as it may grant access to your Google Workspace directory
Next, navigate to the "DETAILS" tab and copy the unique ID of your service account
Open the Advanced settings and under Domain-wide delegation click "View Google Workspace admin console"
Now in the admin console, navigate to API controls

In the API controls, click "Manage domain wide delegation"
On the next screen, add a new API client

Specify the following scopes for your client:
openid, email, profile, https://www.googleapis.com/auth/admin.directory.customer.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.user.readonlyNavigate to the Defguard settings and upload the JSON file you obtained previously. Make sure to also input the email of the account on which behalf the API calls will be made. This account should have access to users and their groups (e.g., email of your account as an admin)
Configuring Google as external OIDC in Defguard
Go to Settings → External identity providers

Click "Connect" in row with Google

Fill Client ID and Client secret. (See Obtaining basic credentials)

Click "Continue"
If you decide to use Directory Synchronization, enable it and fill out "Admin email" and upload Service account key file. (See Obtaining Directory Synchronization credentials)

This feature is currently technically limited to 10000 members or groups. High user or group counts may still trigger your provider API limits even below this threshold. If you have many users (200+), we recommend you test this feature first before you decide to turn on automatic user deletion.
Admin email: The email of the Google Workspace admin user on whose behalf Defguard will call the Google API
Service Account Key: JSON file used to authenticate your application with Google APIs using a service account
Click "Continue"

If no errors occurred during configuration, you will see a message indicating that your OIDC provider has been successfully added
Click "Finish"
Was this helpful?