To connect your Google Workspace to ChatGPT using admin-managed setup, you'll first configure access in Google’s admin consoles:
Create a service account with read-only access to Google Drive, users, and groups.
Create an admin account that the service account will act on behalf of.
Then, complete the setup in the ChatGPT admin console:
Upload the service account’s private key (a JSON file from Google)
Specify the admin account (no credentials required).
Select which files to sync and choose the users who will have access to the connection.
This guide walks through each of these 6 steps.
Setting up a Service Account
Navigate to console.cloud.google.com and click on the projects drop down:
Choose New Project
Input a Project Name
Create the project
Wait until the project has been created, then click on Select Project
Click on APIs & Services
Click on Library
We’re now going to add three APIs, using the search box to find them
Search for and choose Google Drive API
Click Enable
Click on Library
Search for Google Drive Activity
Choose Google Drive Activity API
Click Enable
Click on Library
Search for Admin SDK API
Choose Admin SDK API
Click Enable
Click on Credentials
Click on Create Credentials
Click on Service account
Provide a name and description of your choice for this service account
(Optional) You can assign a role - this is not required by ChatGPT.
(Optional) You can grant access to the service account - this is not required by ChatGPT.
Click Done.
Click on the service account which has now been created.
Click on keys.
Click on Add Key
Click on Create new key
Keep the default JSON key type and click Create
If you see an error message that says “Service account key creation is disabled” follow these steps to enable creation.
Click Close. The key has now been downloaded to your computer. You will later upload this to the ChatGPT admin console.
Click on details
Note that the Unique ID. This will be needed in Step 42.
Expand Advanced settings
Scroll down and click on View Google Workspace Admin Console. The Google Workspace console will open in a new tab.
Click Show more
Expand the Security section
Expand the Access and data controls section
Click on the API controls section
Click on Manage Domain Wide Delegation
Click on Add new
Use the Unique ID previously noted as the value for this Client ID
For the OAuth scopes, refer to the following values that you need to copy and paste
Comma-delimited OAuth scopes | Explanation of scopes |
https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.group.member.readonly, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/admin.directory.user.alias.readonly, https://www.googleapis.com/auth/drive.activity.readonly, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/userinfo.profile, https://www.googleapis.com/auth/userinfo.email |
|
44. Click Authorize
45. Success!
Setting up the Admin Account
Expand Directory
Click on Users
Provide a first name, last name, and primary email address of your choosing
Click Add new user
(Optional) Record these credentials. ChatGPT does not need these credentials.
Click Done.
Click on the account you just created. If it does not appear in the list, refresh the page or clear your cache and cookies and try again.
Click on assign roles.
Toggle on the Groups Reader, User Management Admin, and Storage Admin roles.
Scroll down and click Save. The admin account has now been successfully created and configured.
Completing setup on the ChatGPT Admin Console
Navigate to ChatGPT and click on the profile icon on the upper right corner of the page.
Click on Manage workspace
Click on Connections
Click on Connect
Ensure Admin-managed is selected and click on Next
Type in a display name. We recommend using the name of your Google Workspace.
Please note that we currently do not support changing the name of your connection.
Click Save Draft and Continue
Click Upload key. Choose the JSON file, which is the key you downloaded as part of setting up the service account.
Type in the admin email address. This is the admin account you created previously.
Click Save.
Choose whether you want the files in all of your users’ My Drives to be included.
Click Next
Choose how to manage shared drives. We support the following three scenarios:
If you want to include all shared drives, then choose Include by default and do not add shared drive IDs to be excluded
If you want to include most shared drives, then choose Include by default and add the IDs for the shared drives you want excluded
If you want to exclude most shared drives, then choose Exclude by default and add the IDs for the shared drives you want included
To look up the ID for a shared drive, navigate to it in a web browser. The last portion of the URL is the shared drive ID.
In the following example, it is `0ADvY03uUbEcQUk9PVA`'
Click Next
Choose which users you want to have access to the Google Drive connection.
You can either select users individually or enable it for everyone. If enabled for everyone then new users added to the workspace will automatically be included.
Click Next
Click Start syncing
Your Google Drive connection has now been successfully created!
Please note that, while it will start syncing immediately, it can take hours to days to complete depending on how many files were included based on your settings.
Once files added/edited in the past 30 days have finished syncing, the connector will become available to the users you enabled it for.
Enabling service account key creation
If you receive the following error, you will need to enable service account creation for this specific project:
> The organization policy constraint ‘iam.disableServiceAccountKeyCreation’ is enforced on your organization.
Open up a new tab and navigate to console.cloud.google.com. Make sure the selected project is the one you’ve already selected.
Click on the menu icon in the upper left corner.
Hover over IAM & Admin
Click on Organizational Policies
Search for iam.disableServiceAccountKeyCreation
Click on the result for constraints/iam.disableServiceAccountKeyCreation
Click on the … for the row with the ID of iam.disableServiceAccountKeyCreation
Click on Edit policy. If Edit policy is disabled, you’ll need to become an Organization Policy Administrator.
Click on Override parent’s policy
Click on Add a rule
Click on Set Policy
You can now create a service account key. This enablement may take several minutes to take effect.
Becoming an Organization Policy Administrator
Navigate to console.cloud.google.com and click on the project/organization selector
Click on your organization
Click on the menu icon in the upper-left corner
Hover over IAM & Admin
Click on IAM
Click on the pencil for your account
Click on Add Another Role
Search for Organization Policy Administrator
Click on Organization Policy Administrator
Click Save
Your account now has permission to enable service account key creation. This may take several minutes to take effect.