Google Workspace
You can integrate a Google Workspace (formerly Google Suite) account with Cloudflare Access. Unlike the instructions for generic Google authentication, the steps below will allow you to pull group membership information from your Google Workspace account.
Once integrated, users will log in with their Google Workspace credentials to reach resources protected by Cloudflare Access or to enroll their device into Cloudflare Gateway.
You do not need to be a Google Cloud Platform user to integrate Google Workspace as an identity provider with Cloudflare Zero Trust. You will only need to open the Google Cloud Platform to configure IdP integration settings.
Set up Google Workspace as an identity provider
Log in to the Google Cloud Platform console. This is separate from your Google Workspace console.
A Google Cloud project is required to enable Google Workspace APIs. If you do not already have a Google Cloud project, go to IAM & Admin > Create Project. Name the project and select Create.
Go to APIs & Services and select + Enable APIs and Services. The API Library will load.
In the API Library, search for
admin
and select Admin SDK API.Enable the Admin SDK API.
Return to the APIs & Services page and go to Credentials.
You will see a warning that you need to configure a consent screen. Select Configure Consent Screen.
To configure the consent screen:
- Choose Internal as the User Type. This limits authorization requests to users in your Google Workspace and blocks users who have regular Gmail addresses.
- Name the application, add a support email, and input contact fields. Google Cloud Platform requires an email in your account.
- The Scopes page can be left blank.
- The summary page will load and you can save and exit.
Return to the Credentials page and select + Create Credentials > OAuth client ID.
Choose Web application as the Application type.
Under Authorized JavaScript origins, in the URIs field, enter your team domain.
https://<your-team-name>.cloudflareaccess.comUnder Authorized redirect URIs, in the URIs field, enter your team domain followed by this callback at the end of the path:
/cdn-cgi/access/callback
. For example:https://<your-team-name>.cloudflareaccess.com/cdn-cgi/access/callbackGoogle will present the OAuth Client ID and Secret values. The secret field functions like a password and should not be shared. Copy both values.
On your Google Admin console, go to Security > Access and data control > API controls.
Enable the Trust internal, domain-owned apps option. This setting is disabled by default and must be enabled for Cloudflare Access to work correctly.
On the Zero Trust dashboard, go to Settings > Authentication.
Under Login methods, select Add new and choose Google Workspace.
Input the Client ID and Client Secret fields generated previously. Additionally, input the domain of your Google Workspace account.
(Optional) Enable Proof of Key Exchange (PKCE). PKCE will be performed on all login attempts.
Select Save. To complete setup, you must visit the generated link. If you are not the Google Workspace administrator, share the link with the administrator.
The generated link will prompt you to log in to your Google admin account and to authorize Cloudflare Access to view group information. After allowing permisisons, you will see a success page from Cloudflare Access.
Test your connection
To test that your connection is working, go to Authentication > Login methods and select Test next to Google Workspace. Your user identity and group membership should return.
Example API Configuration
{ "config": { "client_id": "<your client id>", "client_secret": "<your client secret>", "apps_domain": "mycompany.com" }, "type": "google-apps", "name": "my example idp"
}