[Go to site: main page, start]

How to connect Google Apps to Composio with your own OAuth app

5 min read

In this guide, I’ll share the process for customising the auth config for Google using the new Auth Platform dashboard in GCP. So let’s begin.

Setting up Google OAuth

In this section, we’ll go through the process of setting up a Google Developers account/Project and creating an OAuth 2.0 Client ID using the new dashboard.

Note: If you already have a Google Cloud project set up, you can skip the first step.

Step 1: Create a Google Cloud Project (Optional)

If you don’t already have one, create a Google Cloud Project by logging to google cloud console.

Image 1

This gives you a workspace where you can configure OAuth clients and APIs

  1. In the Google Cloud Console, navigate to APIs & Services → API Library → Search for Gmail API and enable it → OAuth consent screen.

Image 2Image 3
  1. This opens the new Auth Platform dashboard.

If this is your first time in the project, the screen will look like this:

Image 4

Now, press the OAuth consent screen, and then you will see the page below.

Image 5

Click Get Started and follow the onboarding wizard:

  1. App Information

    • App Name

    • User support email (dropdown)

  2. Audience

    • Select Internal (only your org’s accounts) or External (any Google user)

Image 6
  1. Contact Information

    • Add developer contact details

  2. Acknowledgement

    • Review and click Create

Image 7

Once done, you’ll see the Consent Screen Overview page.

Step 4: Create OAuth Client Credentials

  1. On the consent screen overview, click Create OAuth client.

Image 8
  1. You’ll be redirected to the Clients page.

  2. Configure the client:

  • Application type: e.g., Web application

  • Client name: choose any name for your app

  • Authorized JavaScript origins: leave empty. Composio’s flow is server-side, and adding composio.dev here also blocks Google domain verification.

Leave this field empty
  • Authorized redirect URIs:

https://backend.composio.dev/api/v1/auth-apps/add

Planning to verify your app with Google? Google requires you to verify every domain on your OAuth client in Search Console, and this Composio callback puts composio.dev on the client, which you can’t verify. Register a callback URL on your own domain that forwards to Composio instead. See Use a callback URL on your own domain.

  1. Pick a URL on a domain you own, for example https://auth.yourapp.com/oauth/callback.

  2. Make that URL send a 302 redirect to https://backend.composio.dev/api/v3/toolkits/auth/callback and keep everything after the ? exactly as it is. The example below does this in Next.js.

  3. Add your URL here under Authorized redirect URIs. Keep the Composio URL too until your test connection works, then remove it.

  4. In Composio, enter the same URL in the auth config’s Redirect URI field, then connect one test account and confirm it shows Active.

// app/oauth/callback/route.ts (Next.js)
const COMPOSIO_CALLBACK = 'https://backend.composio.dev/api/v3/toolkits/auth/callback';

<p>export function GET(request: Request) {
  const { search } = new URL(request.url);
  return new Response(null, {
    status: 302,
    headers: {
      Location: COMPOSIO_CALLBACK + search,
      'Cache-Control': 'no-store',
      'Referrer-Policy': 'no-referrer',
    },
  });
}</p>

Express and Cloudflare Worker versions, a test command, and the full Google order are in Use a callback URL on your own domain.

  • Click Create

Image 9
  1. After creation, Google will generate your OAuth Client ID.
    You can copy them immediately, or later find them again on the Clients page by clicking the client entry.

Image 10

Now, after clicking OK, you will see the page below. From there, you can click on your client name to proceed.

Image 11

After clicking on your respective client name, you can now create a Client Secret associated with your Client ID.

Image 12

Step 5: Set App Status (Publish or Test)

  • Testing Mode:

    • Keep your app in testing while building.

    • Add specific test users (emails) to validate authentication.

  • Production Mode:

    • Once you set the app status as In production, it becomes available to all Google users.

    • Depending on your configuration, you may need to submit the app for Google verification.

Image 13

For now, add yourself (or your test users) under the Test Users section to validate your setup.

Testing apps lose access after seven days. For External apps in Testing, Google expires refresh tokens after seven days unless the app only requests basic profile and email scopes, so connected accounts stop working until users reconnect. Set the app to In production before real use. See Manage app audience.

Restricted scopes need a security assessment. Gmail and Drive scopes such as https://mail.google.com/ and https://www.googleapis.com/auth/drive are restricted. Public production use requires restricted-scope verification and, when restricted data is stored or transmitted on servers, an annual security assessment. Request only the scopes your workflow needs. See Restricted scope verification.

Creating the Auth Config in Composio

With your OAuth credentials ready, navigate to the Composio Dashboard to configure Google authentication.

  1. Click Create Auth Config

  2. Choose Gmail from the toolkit list.

Image 14
  1. Make sure OAuth2 is selected

  2. Check “Use your own developer credentials”

Step 6: Fill in the Auth Config

Go to Manage Auth Config and paste your credentials:

  • Client ID → from GCP OAuth Client

  • Client Secret → from GCP OAuth Client

  • Redirect URI → must match the one you configured in GCP

<a href="https://backend.composio.dev/api/v1/auth-apps/add">https://backend.composio.dev/api/v1/auth-apps/add</a>
Image 15

You can also customize the scopes if needed (request only the scopes you use; broader scopes can require stricter Google verification).

Finally, click Create Auth Config. You’ll now have a Config ID (ac_...) that can be used in your app code to trigger authentication via Google

Extending to Other Google Services

The process above was for setting up Google OAuth with Composio Auth Platform. You can follow the same steps to integrate other Google services (Sheets, Calendar, Drive, etc.) into your Composio setup.

  • Simply go to APIs & Services → Library in your GCP project.

  • Enable the APIs you want (e.g., Google Sheets API, Google Calendar API).

  • Reuse the same OAuth Client you created earlier or create a new one if needed.

You can search in the Library for the respective service you want to use, such as Google Docs, Google Sheets, Google Calendar, or Google Drive, enable the required API service, and then use the same credentials for configuration.

Image 16Image 17Image 18Image 19

Share