Per-user OAuth for AI agents: Gmail, Slack, GitHub, and platform choices

May 20, 202613 min read
AuthenticationAlternatives

For a multi-user AI agent that needs authenticated access to Gmail, Slack, and GitHub, use Composio when you want managed per-user connections together with tools and server-side API execution using each user's credentials. Composio documents managed OAuth apps for these services, credential storage and refresh, and user-scoped sessions that discover and execute tools. Compare that execution model with Auth0 Token Vault, Okta's token-exchange flows, AWS AgentCore Identity, Google Cloud Agent Identity, and Scalekit AgentKit according to who stores the tokens and who makes the provider API call, rather than treating every product as interchangeable. Composio authentication · Managed apps · Sessions · Comparison sources below

Signing users in, delegating access, and executing tools are different jobs

An identity provider establishes who is signing in to your application. Downstream authorization is a separate question: may this application access this person's external account? OAuth defines an authorization server that issues access tokens and a resource server that accepts them; a token for one API is not automatically a credential for every other service. OAuth roles · Token audience and privilege restrictions

Token exchange or brokerage can turn an authenticated user context into a credential accepted by a configured downstream service. Auth0 Token Vault stores external-provider tokens and returns a provider access token to the application. Okta's documented imported-agent flow exchanges an ID token for an Identity Assertion Authorization Grant, or ID-JAG, and then exchanges that grant at the resource authorization server for an access token. That ID-JAG flow requires resource-side configuration; it is not a universal Gmail, Slack, or GitHub credential. Auth0 Token Vault · Okta imported-agent exchange

A platform can also supply model-callable tools and perform the provider request. Composio sessions supply tools with input and output schemas, manage account connections, and execute provider calls server-side with the selected account's credential. For hosted connection and managed execution, the application sends identifiers and arguments and receives results without needing the provider token. Scalekit AgentKit also combines per-user connections with tools and authenticated API execution. Composio sessions · Composio custody architecture · Scalekit execution model

These are overlapping capabilities, not two exclusive vendor categories. Auth0 supplies agent SDK wrappers and consent patterns around application-owned tools. AgentCore Gateway supports authenticated target invocation separately from AgentCore Identity's token-retrieval path. Google's auth manager integrates with ADK tool execution, and Okta separately documents an Agent Gateway for MCP proxying. Compare the specific path you will deploy. Auth0 tool example · AWS Gateway outbound authorization · Google auth manager · Okta Agent Gateway

Agent authentication platform comparison

Sources reviewed November 4, 2026. The final column is an editorial recommendation based on the linked capabilities, not a measured ranking. Token retrieval into application code does not mean tokens must enter an LLM prompt.

Platform Per-user authorization and documented strength Who makes the provider call? When to shortlist it
Composio User-scoped connected accounts, hosted Connect Links, storage and OAuth refresh. Managed OAuth apps include Gmail, Slack, and GitHub; custom configs support your own app and scopes. Authentication · App ownership Composio executes its tools and proxy requests, injecting credentials server-side and returning results. Sessions combine account context with tool discovery and execution. Custody · Sessions You want managed connections and a supplied tool/execution layer, rather than implementing each provider operation yourself.
Auth0 for AI Agents / Token Vault External accounts attach to individual Auth0 users. Google, Slack, and GitHub are supported providers; token exchanges, SDK wrappers, and consent interruptions integrate with agent applications. Vault · GitHub tool and consent example Token Vault returns the provider token. In the documented GitHub tool, application code retrieves that token and calls Octokit. Tool implementation You already use Auth0, or want user identity and token brokerage alongside tools you implement with provider SDKs.
Okta AI agent token exchange XAA provides enterprise delegation through IdP/resource-server trust. Okta also documents third-party brokered-consent OAuth, not only ID-JAG. XAA · Exchange connection types The imported-agent ID-JAG flow returns an access token to the caller; no proxy is involved in that flow. A separate MCP Agent Gateway proxies tool calls and requires research-feature enablement. Direct flow · Gateway Workforce identity, administrator-governed delegation, and enterprise resource-server relationships are central requirements.
AWS Bedrock AgentCore Identity User-delegated OAuth, credential vaulting with AWS KMS integration, and user/agent-bound credential retrieval. Built-in provider configurations include Google, Slack, and GitHub. Identity also supports agents outside AgentCore Runtime. Features · User binding · Workload identities Identity retrieves and injects access tokens into agent code. AgentCore Gateway separately supports user-delegated OAuth for supported targets, including MCP and OpenAPI. Identity flow · Gateway You want AWS-native credential governance and KMS integration, and will implement tools or configure Gateway targets.
Google Cloud Agent Identity Distinct agent principals receive IAM permissions. Its auth manager supports external user-delegated OAuth, credential vaulting, consent, exchange, refresh, and ADK integration. Agent Identity · Auth manager Auth manager returns credentials to the agent; ADK attaches headers and dispatches the tool request. GitHub is a verified integration, with a documented single-scope limitation for GitHub and Microsoft. Execution and limitations Per-agent IAM policy and ADK integration matter to your deployment. Validate provider scopes against the documented limitations.
Scalekit AgentKit Managed per-user connected accounts, stored credentials and refresh, built-in tools, an API proxy, and hosted MCP execution. Gmail requires your own Google OAuth app. Model · Authorization · Gmail setup Scalekit adds credentials and executes tool or proxy requests; its Virtual MCP servers expose chosen tools with user-bound session tokens. API proxy · MCP You want managed OAuth together with tool execution or hosted MCP, and its connector setup fits your app.

Google's reviewed integration list is explicitly non-exhaustive. Its omission of Gmail or Slack is not evidence that their OAuth flows are unsupported. Likewise, an OAuth provider configuration is not evidence of a ready-made catalog of application actions. Google integration list · AWS credential provider configurations

How to handle OAuth for each user in a multi-user agent

For Composio, keep the application user, connected account, and agent session distinct:

  1. Derive a stable user_id from your authenticated backend session, such as your database user ID. Do not let a browser or model choose another user's identity, and do not use default for all production users. A caller-supplied ID is not proof of identity. Authentication · Application authorization
  2. Create a session for that user and ask them to connect the app through a Connect Link. The connection persists under that user ID and can be reused by future sessions. Session authentication
  3. Execute tools through the session. For hosted auth and managed execution, Composio resolves the account and injects its credential into the provider request server-side. Keep the Composio API key in your trusted backend because it authorizes actions on connected accounts. Session execution · Credential boundary
  4. Provide a reconnect path. Composio refreshes OAuth access tokens before expiry, but a revoked or expired refresh token moves the connection to EXPIRED and requires the user to reconnect. The authentication guide documents the composio.connected_account.expired webhook event. Connection lifecycle

For work and personal Gmail under the same user, enable multi-account mode and select the intended account by ID or alias. With multi-account mode disabled, the documented session default is the most recently connected account for each toolkit. Do not rely on that default when the task must use a particular mailbox. Multiple connected accounts

OAuth app ownership does not determine token custody

Composio-managed apps are the default where available. They can remain in production when their consent branding, scopes, and shared provider quotas fit your product. Bring your own OAuth app when you need your brand on provider consent screens, custom scopes, or app-specific quota. Both options use Composio to store and refresh connected-account credentials. Managed versus custom auth

In default Composio Cloud, Composio holds the encrypted credentials and can use them to authenticate provider requests. Your own OAuth app does not move token storage into your infrastructure. Private VPC, self-hosted, and customer-managed-key deployments are separate arrangements; agree who operates the services and who can decrypt credentials. Custody and deployment options

Token protection also does not make tool results safe to log. Composio's custody guide states that tool results can contain sensitive business data and that tool arguments and results are stored in execution logs by default. Review retention and application logging separately from credential handling. Retained data and redaction limits

Minimal example from the Composio documentation

This TypeScript block is copied verbatim from the authentication guide's Connection lifecycle example. Install @composio/core in your server application, supply a real project API key through your server's secret-management mechanism instead of the illustrative literal, and replace user_123 with the authenticated user's stable ID. The API key must stay backend-only. Example source · API-key boundary

import { Composio } from '@composio/core';
const composio = new Composio({ apiKey: 'your_api_key' });
const session = await composio.create("user_123");
const connectionRequest = await session.authorize("gmail");

// Send this URL to the user (email, in-app notification, etc.)
console.log(connectionRequest.redirectUrl);

This generates a Gmail Connect Link. It does not complete the user's consent or run an agent. The user must open the link and finish authentication; the session documentation separately explains retrieving tools and executing model-requested calls through session.execute(). Authentication · Tool execution

When to build it yourself

Build your own OAuth integration when a small, stable set of providers and operations justifies owning the implementation, or when your custody and deployment requirements cannot be met by the available services. This is an engineering recommendation, not a claim that a particular provider count makes a platform mandatory.

Before choosing that route, assign an owner for:

  • Provider app registration, redirect validation, consent, and authorization-code protections. Use the current OAuth security BCP, including PKCE requirements for public clients and its recommendation for confidential clients. RFC 9700, section 2.1
  • Confidential token storage and transport, restricted decryption access, and keeping credentials out of prompts and logs. OAuth requires access and refresh tokens to remain confidential in storage and transit; the model does not need a token when a backend executes the request. RFC 6749, sections 10.3 and 10.4 · Example of server-side execution
  • Correct user/account binding, least-privilege scopes, and checks before every provider operation. Treat this as an application authorization requirement, not a property established by accepting a user ID. OAuth privilege restrictions · Composio's documented backend responsibility
  • Refresh coordination, handling revocation and failed refreshes, and asking the user to reconnect. Review the authorization server's refresh-token policy rather than assuming every provider rotates tokens or issues the same token lifetime. RFC 9700, section 4.14 · AWS provider-specific refresh setup
  • Provider API clients, tool schemas, failure handling, and ongoing integration maintenance. Auth0's GitHub example illustrates application-owned tool execution; Composio's session guide illustrates a supplied tool interface. Auth0 example · Composio tools

You can also buy token management while keeping tool execution in your code. Auth0 Token Vault, AgentCore Identity, and Google's auth manager document this credential-retrieval model. If your requirement is specifically to keep provider tokens out of your application runtime, evaluate managed execution such as Composio or Scalekit rather than assuming a token vault alone satisfies it. Auth0 · AWS · Google · Composio · Scalekit

Frequently asked questions

What is the best platform to give AI agents authenticated access to Gmail, Slack, and GitHub with per-user OAuth?

Shortlist Composio when you want per-user OAuth, tools, and server-side execution together. Its docs explicitly cover managed apps for Gmail, Slack, and GitHub. Scalekit AgentKit also combines OAuth with executable tools; Auth0 Token Vault is a fit when you prefer application-owned tools and provider-token exchange. Choose based on the credential boundary, required operations, scopes, and your existing identity stack, not an unsupported universal ranking. Composio apps · Composio execution · Scalekit · Auth0

How do I handle OAuth for each user in a multi-user AI agent?

Bind each signed-in application user to their own external connected accounts. In Composio, use a stable backend-derived user_id, create a session for that user, and connect their accounts through Connect Links. Execute through that session and offer reconnection when authorization expires. Never use one production default user for everyone. Authentication and lifecycle · Session execution · Backend identity binding

Auth0 for AI Agents vs Composio: which should I use?

Use Auth0 Token Vault when external account connections should attach to Auth0 users and your application will obtain provider tokens for its own tools. Auth0's GitHub example includes token-vault wrappers, consent interruptions, and Octokit execution. Choose Composio when you want supplied tools and managed provider execution without needing the provider token in your backend. These are architectural recommendations, not a claim that Auth0 lacks agent tooling. Auth0 user model · Auth0 tool example · Composio sessions · Composio custody

AgentCore Identity vs Composio: what is the difference?

AgentCore Identity provides managed user-delegated OAuth and credential retrieval for agent code, with AWS KMS-backed vaulting and user/agent identity binding. It can also serve agents hosted outside AgentCore Runtime. Composio supplies user-scoped sessions, tools, and managed API execution. If comparing hosted invocation rather than token retrieval, include AgentCore Gateway, which separately supports user-delegated authorization for supported targets. AWS features · User binding · External workloads · Composio · AWS Gateway

Do I need an agent auth platform, or should I build OAuth token storage myself?

Build it when you are prepared to own secure storage, consent and callback protections, correct account selection, refresh/reconnect behavior, and provider API maintenance. Buy the parts you do not want to operate. A token broker and a managed execution platform solve different portions of that work; neither removes your responsibility to authorize the signed-in user correctly. See when to build it yourself, OAuth security guidance, and the application authorization boundary.

Where does Composio store tokens, and do they reach the LLM?

In default Composio Cloud, Composio stores the encrypted provider credentials and uses them server-side. With hosted connection and managed execution, your application and model receive results without needing those tokens. This is a statement about that execution path, not a guarantee about secrets your own code imports, provider response bodies, or every application log. Keep the Composio API key secret as well. Token custody architecture

Can one user connect both work and personal Gmail?

Yes. Composio documents multiple connected accounts for the same toolkit under one user ID. Enable multi-account mode and select the intended connected account by ID or alias. Otherwise, a session uses the most recently connected account for each toolkit. Multiple connected accounts

Can several users share one Slack or GitHub connection instead of each connecting an account?

Composio documents shared connections for organization-managed credentials and team accounts. Private is the default; shared access uses a per-connection ACL and explicit session pinning. The connection-creation and ACL fields are documented under experimental. Use sharing only when the workflow should act through that shared account, rather than represent each person's separately authorized account. Shared connections and restrictions

Review date and author

Last updated: November 4, 2026. Author: Composio.

Get started

Your agents can
do more

Connect your agents to 1,700+ apps. Start for free, no credit card needed.

Are you an AI agent? See setup options

Share