You can connect your Google Workspace Service Accounts by following these steps:
Create a Service Account
- Open Service Accounts in the Google Cloud Platform. It will redirect you to the below page.
-
Select your project and click Create Service Account.
-
Fill out the form for the Service account name, Service account ID and Service account description.
-
Click Create and Continue.
Grant This Service Account Access to Project
Select a role from the Select a role dropdown. You can also add another role and then click Continue.
*This is an optional step and can be skipped.
Grant Users Access to This Service Account
In this step, grant access to users or groups that need to perform actions as this service account and then click Done.
*This is an optional step and can be skipped.
Create Service Account Key
- Select the account from the list of Service accounts.
- Click Actions.
- Select Manage Keys from the dropdown.
- Select Add Key > Create new key.
- Select JSON and a new key will be downloaded. Treat your key like a password and store it securely.
Delegate Domain Wide Authority
You'll need your Client ID. You can access that in two ways:
- The key you downloaded at this step will have the Client ID.
- The Unique ID is on the Details page.
You can get your Client ID from the service accounts JSON download.
- Go to Google Workspace Admin console.
- Go to Security > API Controls.
- Under Domain wide delegation, click Manage Domain Wide Delegation.
- Click Add New.
- Enter the Client ID.
- In the OAuth scopes field, enter the following text:
<https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/userinfo.profile,https://www.googleapis.com/auth/calendar,https://www.googleapis.com/auth/admin.directory.user.readonly>
-
Click Authorize.