Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
md 70 lines 5.76 KB
Rendered Raw
1 ## How do I set up custom Google OAuth credentials for Google Contacts?
2
3 Google Contacts has no Composio-managed OAuth app, so you need your own Google OAuth app to connect it.
4
5 ### Create the Google OAuth app
6
7 1. Open the [Google Cloud console](https://console.cloud.google.com/) and select the project that will own the OAuth app, or create one.
8
9 ![Google Cloud project picker with the OAuth app's project selected](/images/toolkits/shared/9j8wjr2HocIhIsgedntpgb4m8Y.webp)
10
11 2. Go to **APIs & Services** → **Library**, search for **People API**, and click **Enable**. Google Contacts tools use the People API, not the retired Contacts API. If the API page shows **Manage**, the API is already enabled. Enabling an API needs project permissions; ask your project admin if you can't.
12
13 ![People API page in the Google Cloud API Library with the Enable button](/images/toolkits/googlecontacts/enable-people-api.webp)
14
15 ![People API details page showing the API is enabled](/images/toolkits/googlecontacts/people-api-enabled.webp)
16
17 3. Go to **Google Auth Platform** → **Branding**. If you see **Get started**, enter the app name, user support email, and developer contact email, then save.
18
19 ![Google Auth Platform Branding page with the app name and user support email fields](/images/toolkits/shared/Q8INvnJoiCMyajqrrAtq6ovCE5U.webp)
20
21 4. Under **Audience**, choose the user type. **Internal** limits sign-in to accounts in your Google Workspace organization. **External** allows any Google account. An External app starts in **Testing**; add every account that will connect under **Test users**.
22
23 ![Google Auth Platform Audience page showing Testing status, the External user type, and Test users](/images/toolkits/shared/BetTxXqa2c1dgg4QeV4g9RV008.webp)
24
25 5. Under **Data Access**, click **Add or remove scopes** and add the scopes your auth config will request (see **Scopes** below). Paste any scope missing from the list under **Manually add scopes** and click **Add to table**. Click **Update**, then **Save**.
26
27 ![Data Access scope picker with the contacts.readonly scope selected](/images/toolkits/googlecontacts/data-access-scopes.webp)
28
29 6. Under **Clients**, click **Create client**. Set **Application type** to **Web application**, name the client, and add this URI under **Authorized redirect URIs**:
30
31 ```
32 https://backend.composio.dev/api/v1/auth-apps/add
33 ```
34
35 It must exactly match the `oauth_redirect_uri` field of your Composio auth config.
36
37 ![Create OAuth client ID form with Web application selected](/images/toolkits/shared/S7mFFv6C5mCP4y0ScTzRzQd8Nc.webp)
38
39 ![Create OAuth client ID form with the Composio redirect URI under Authorized redirect URIs](/images/toolkits/shared/1qh7A0aEGRUU1K19aU37FrcxTY.webp)
40
41 7. Click **Create**. Copy the **Client ID** and **Client secret** before you close the dialog, and store the secret privately.
42
43 ### Create the auth config in Composio
44
45 1. In the [Composio dashboard](https://dashboard.composio.dev/~/project/auth-configs?utm_source=docs&utm_medium=content&utm_campaign=toolkits-googlecontacts), go to **Auth Configs** → **Create** and select **Google Contacts**.
46 2. Choose **OAuth 2.0** and **Your Own Credentials**. Paste the **Client ID** and **Client secret**, and leave **Redirect URI** set to `https://backend.composio.dev/api/v1/auth-apps/add`.
47 3. Choose the scopes your tools need, matching the ones you added under **Data Access**, then click **Create Auth Config**.
48 4. Click **Connect Account**, sign in with a Google account that can use the app (a test user while the app is in **Testing**), and approve the consent screen. Under **Accounts**, confirm the connection shows **Active**.
49
50 ![Google's unverified-app notice for an app in Testing](/images/toolkits/shared/Mavl5IyzWvxI5tP64ScXgpeyI94.webp)
51
52 ![Google consent screen asking to see and download contacts](/images/toolkits/googlecontacts/google-consent-screen.webp)
53
54 For the general flow, see [custom auth configs](/docs/auth-configuration/custom-auth-configs).
55
56 ### Scopes
57
58 The default Google Contacts auth config requests `https://www.googleapis.com/auth/contacts`, `contacts.other.readonly`, `directory.readonly`, `user.emails.read`, `userinfo.email`, and `userinfo.profile`. For read-only access to the user's own contacts, `contacts.readonly` is enough. `directory.readonly` searches the Workspace directory, and whether it returns results depends on your organization's policy. See Google's [People API reference](https://developers.google.com/people/api/rest/v1/people.connections/list).
59
60 Short scope names on this page leave out the `https://www.googleapis.com/auth/` prefix. When you paste a scope under **Manually add scopes**, use the full URL, for example `https://www.googleapis.com/auth/userinfo.email`. Scopes already written as a full URL, such as `https://mail.google.com/`, go in as shown.
61
62 If you change the scopes later, reconnect the account so the user grants the new access.
63
64 ### Testing, publishing, and verification
65
66 - While an External app is in **Testing**, only test users can connect, and Google can show them an unverified-app notice. Google generally expires their authorizations after seven days, so they need to reconnect.
67 - To let any Google account connect, publish the app under **Audience**. Publishing doesn't verify the app.
68 - Public apps that request sensitive or restricted scopes generally need Google's OAuth verification. Check **Google Auth Platform** → **Verification Center**. Internal apps and apps in Testing can be exempt. See Google's [verification requirements](https://developers.google.com/identity/protocols/oauth2/production-readiness/overview).
69 - **Data Access** shows which of your scopes Google treats as sensitive or restricted.
70 - If Google blocks sign-in, check the app's audience, the test user list, the requested scopes, and your Workspace admin's app access policy.