This page describes how to configure OAuth to connect Google Chat to Gemini Enterprise as a data store.
Set up authentication and permissions for Google Chat
To enable Google Chat actions, a Google Cloud administrator must perform the following steps to enable the Google Chat API and set up authentication.
Enable the Google Chat API
In your Google Cloud console project, enable the Google Chat API.
Configure the app
After enabling the API, navigate to the Configuration tab and set up your app details as follows:
- App name: Enter a name for the app (for example,
Gemini Enterprise). Users will see this name when your app sends a message. - Avatar URL: Provide the URL for the Gemini Enterprise icon. This icon will appear next to the app name in chat threads.
- Description: Enter a description (for example,
Google Chat app for Gemini Enterprise).
- App name: Enter a name for the app (for example,
Under App status, ensure that the status is set to LIVE.
Click Save.
Create an OAuth app and add scopes
If you don't have an OAuth app, follow these steps. If you already have an OAuth app, skip to Create OAuth client credentials.
Go to Google Auth Platform > Overview.
Click Get started.
Enter a name for your OAuth app.
In User support email, select a support email address for your application's users to contact with questions about their consent.
Under Audience, select the user type for your app:
- External: Select External if you're creating an app for use outside of your Google Workspace organization. This makes the app publicly available to any user with a Google account.
If you selected External, add test users:
- Click Audience.
- Under Test users, click Add users.
- Enter your email address and any other authorized test users, then click Save.
- Internal: Select Internal if the app is restricted to members of a specific Google Cloud organization, limiting access to Google Workspace organizational members only.
- External: Select External if you're creating an app for use outside of your Google Workspace organization. This makes the app publicly available to any user with a Google account.
If you selected External, add test users:
Click Next.
Under Contact Information, enter an email address where you can be notified about any changes to your project.
Click Next.
Under Finish, review the Google API Services User Data Policy. If you agree, select I agree to the Google API Services: User Data Policy.
Click Continue.
Click Create.
After you create the app, you can update the OAuth Consent Screen settings in Branding and Audience.
Add scopes
To add the minimum required scopes, follow these steps:
- In the Google Cloud console, go to Menu .
- Select Data Access from the navigation menu.
- Click Add or Remove Scopes.
- Under Manually add scopes, paste the following scopes for Google Chat based on your requirements:
| Connection mode | Scope | Purpose |
|---|---|---|
| Federated search | ● https://www.googleapis.com/auth/chat.spaces.readonly● https://www.googleapis.com/auth/chat.messages.readonly |
Minimum permission required to search and retrieve content. Allows the data store to list spaces and read messages |
| Federated search and Actions | ● https://www.googleapis.com/auth/chat.spaces.readonly● https://www.googleapis.com/auth/chat.messages.readonly |
These scopes are required for searching content and executing space-level actions |
5. Click Add to table and then click Update.
6. Click Save.
Create OAuth client credentials
This procedure describes how to create a new OAuth client ID for Google Cloud actions. If you already have an OAuth client ID for Google Cloud actions, you can use that client ID and secret for Google Chat actions instead of creating a new one.
Click Create client.
For Application type, select Web application.
In the Name field, enter a name for the credential.
Skip Authorized JavaScript origins.
In the Authorized redirect URIs section, click Add URI and enter the following URI:
https://vertexaisearch.cloud.google.com/oauth-redirectClick Create. The newly created credential appears under OAuth 2.0 Client IDs. Open the client you just created and copy the following information:
- Client ID
- Client secret