How to Create an OAuth App for Google Workspace
Follow the steps below to create an OAuth 2.0 Client ID for your application.
Our sandbox application didn't go through the full Google security audit. If the app or site doesn't meet Google's security standards, Google might block you from signing into your account via it by default. This can be turned off if you understand the risk: https://myaccount.google.com/lesssecureapps. This guide describes how to create your own sandbox application.
Step 1: Prerequisites
Before you begin, make sure you have the following:
- A Google account
- An Apideck account
Step 2: Go to Google Cloud Console
Go to Google Cloud Console.
Step 3: Create a New Project
- Click on the project drop-down and select
New Project
. - Give your project a name and click
Create
.
Step 4: Enable the Google Workspace APIs You Need
- In the sidebar, click on
Library
. - Search for and enable the APIs you need, Admin SDK.
Step 5: Create Credentials
- Click on
Credentials
in the sidebar. - Click
Create Credentials
and selectOAuth client ID
.
Step 6: Configure the OAuth Consent Screen
- You'll be prompted to configure the
OAuth Consent Screen
before creating the credentials. - Select
External
so the app is available to any user with a Google account. - Fill in the required details like
App name
,User support email
, etc. - In the
Scopes
section, add the scopes that your application needs.- https://www.googleapis.com/auth/admin.directory.group.member (View and manage group members on your domain)
- https://www.googleapis.com/auth/admin.directory.group.member.readonly (View group subscriptions on your domain)
- https://www.googleapis.com/auth/admin.directory.group (View and manage the provisioning of groups on your domain)
- https://www.googleapis.com/auth/admin.directory.group.readonly (View groups on your domain)
- https://www.googleapis.com/auth/admin.directory.orgunit (View and manage organization units on your domain)
- https://www.googleapis.com/auth/admin.directory.orgunit.readonly (View organization units on your domain)
- https://www.googleapis.com/auth/admin.directory.user (View and manage the provisioning of users on your domain)
- https://www.googleapis.com/auth/admin.directory.user.readonly (View users on your domain)
- https://www.googleapis.com/auth/admin.directory.user.alias (View and manage user aliases on your domain)
- https://www.googleapis.com/auth/admin.directory.user.alias.readonly (View user aliases on your domain)
- https://www.googleapis.com/auth/admin.directory.user.security (View and manage security settings on your domain)
- https://www.googleapis.com/auth/cloud-platform (View and manage your data across Google Cloud Platform services)
- Click
Save and Continue
.
Google App Verification Process Details
If your app will be used by more than 100 users or requests sensitive scopes (which Google Workspace access is considered), you need to complete Google's verification process:
-
Complete your OAuth consent screen: Ensure all required fields are filled in (app name, support email, developer contact information, privacy policy URL, etc.)
-
Add appropriate scopes: For Google Workspace, add the necessary scopes mentioned above
-
Submit for verification: Click "Submit for verification" button on the OAuth consent screen page
-
Verification requirements:
- Valid privacy policy URL that properly describes data collection and usage
- A homepage or landing page for your application
- Demonstration of legitimate use case for requested scopes
- Screenshots or video of your application's OAuth implementation flow
-
Verification timeline:
- Basic verification typically takes 3-5 business days
- Apps requesting sensitive scopes may require 4-6 weeks for review
-
During review period:
- You can test with up to 100 users (Developer Identity) even without verification
- For internal company use, consider using "Internal" user type which doesn't require verification
Important: While waiting for verification, you can still use your application in development/testing mode with up to 100 users, or by having users click "Advanced" and then "Continue to [your app]" when they see the unverified app warning.
Step 7: Create OAuth Client ID
- Choose the application type. If you're creating a Web application, select
Web application
. - Name your OAuth 2.0 client.
- Add your
Authorized JavaScript origins
andAuthorized redirect URIs
. - Click
Create
.
Step 8: Configure a Custom redirect URI
To enable the connection to your Google Workspace instance and be compliant with the Google certification, it is required use your own whitelabel auth URIs.
💡 IMPORTANT: Once you have applied one of the options, don't forget to update the "Redirect URI" in your Google Workspace configuration as described in step 5.
Setup a custom subdomain for Apideck Vault
Add a custom domain name for Apideck Vault. This will allow you to whitelabel the reference to Apideck's Vault.
- Create a CNAME record
Sign in to your DNS name server host and navigate to your DNS settings. Add a CNAME record with the value
cname.vercel-dns.com.
[REPLACE_WITH_DESIRED_SUBDOMAIN] CNAME cname.vercel-dns.com.
- Contact Apideck
Get in touch with your Apideck contact or support@apideck.com to let us know about the custom domain you want to use, so we can configure & enable it for Apideck Vault.
- Wait for the changes to propagate
Congratulations! You have now pointed your custom domain to Apideck Vault! When DNS changes are made, you can expect a propagation time up to 24 hours (but mostly much less than that). This is because it takes time for the DNS to take effect across the internet. The actual time of propagation may vary in some locations based on your network setup.
- Update the "Redirect URI"
Update the "Redirect URI" in your Google Workspace configuration as described in step 5.
- Save your changes and submit your consent screen for verification.
Step 9: Configure your Client ID and Secret in Apideck
Now that you've set up your OAuth app, you can configure the Google Workspace connector in Apideck using the client ID and secret generated earlier.
Do your first API call to the Google Workspace API via our HRIS API
-
Connect your Google Workspace account through Vault with a test session.
-
To test the access token, make a query to get
Employees
.
curl --location --request GET 'https://unify.apideck.com/hris/employees' \ --header 'x-apideck-consumer-id: test-consumer' \ --header 'x-apideck-app-id: {APIDECK_APP_ID}' \ --header 'x-apideck-service-id: google-workspace' \ --header 'Authorization: Bearer {APIDECK_API_KEY}' --header 'Content-Type: application/json' \
Do your first API call to the Google Workspace API via our Proxy API
-
Connect your Google Workspace account through Vault with a test session.
-
To test the access token, make a call to the
List users
endpoint using the Proxy API.
curl --location --request GET 'https://unify.apideck.com/proxy' \ --header 'x-apideck-consumer-id: test-consumer' \ --header 'x-apideck-app-id: {APIDECK_APP_ID}' \ --header 'x-apideck-service-id: google-workspace' \ --header 'x-apideck-downstream-url: https://admin.googleapis.com/admin/directory/v1/users' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {APIDECK_API_KEY}'
Start building with the Google Workspace API
Learn what else you can build with the Google Workspace API.
Interested in a personalized demo? Let us know.