How ChatGPT’s Token Works
ChatGPT authenticates the user and sends a standard OAuth access token where thesub claim is the authenticated user. The token does not include delegation semantics — there is no act claim or separate agent identity. From the token alone, the Gateway cannot distinguish “ChatGPT acting on behalf of the user” from “the user directly.”
This has implications for how the Gateway evaluates and processes requests:
- Inbound authorization policies operate on the token as received. Since ChatGPT does not perform a token exchange before calling the Gateway, inbound OPA policies see only the claims in the access token — user identity claims (
sub,email,groups, etc.) and theclient_ididentifying the OAuth client. Theclient_idis a required claim in JWT access tokens per RFC 9068, so admins can write policies that target ChatGPT traffic by matching on it. When using CIMD, theclient_idis a URL (e.g.,https://chatgpt.com/oauth/{id}/client.json) rather than a simple string — see the policy example in Harden Tool Access. - Outbound token exchange is where the Gateway adds delegation semantics. When the Gateway performs RFC 8693 token exchange to call upstream APIs via MCP Bridge or MCP Proxy, it can mint delegation tokens with an
actclaim that includes the agent’s client identity. This gives upstream services visibility into both the user and the agent that initiated the request.
ChatGPT uses OAuth Client ID Metadata Documents
(CIMD)
natively, presenting a verifiable HTTPS URL as its
client_id. This is a
meaningful improvement over agents that use self-asserted client identity
strings — the Auth Provider Orchestrator fetches and validates the metadata
document, giving inbound policies a cryptographically grounded client
identity to match on.Prerequisites
- A running AI Identity Gateway — Follow the AI Identity overview to set up the Auth Provider Orchestrator and AI Identity Gateway Orchestrator with at least one MCP Bridge or MCP Proxy app configured.
- OAuth authorization enabled on the MCP Provider — The Gateway’s
mcpProvider.authorization.oauthmust be enabled so ChatGPT can authenticate. See the AI Identity Gateway reference for configuration details. - ChatGPT Business or Enterprise/Edu account — Creating and publishing workspace apps requires a Business or Enterprise/Edu workspace. Owners and Admins can publish apps; individual members install them.
Register ChatGPT as an OAuth Client
Configure the Auth Provider Orchestrator to accept ChatGPT using Client ID Metadata Documents (CIMD). CIMD eliminates the need to pre-register a client ID, secret, redirect URLs, or scopes — a singleoidcCimd app with allowedDomains: [chatgpt.com] is all that is required. See the CIMD reference for configuration steps and options.
Connect ChatGPT to the Gateway
Once the Auth Provider Orchestrator is configured, a workspace Owner or Admin creates and publishes the ChatGPT app so that workspace members can install it. ChatGPT routes all MCP traffic through OpenAI’s infrastructure, so the AI Identity Gateway and Auth Provider Orchestrator must both be accessible from the public internet. Admin setup:1
Open the Apps admin panel
Go to chatgpt.com/admin/apps. You must be a workspace Owner or Admin to access this page.
2
Create a new app
Click + Create. The New App dialog opens.
3
Enter the app details and Gateway URL
Enter a Name and optional Description for the app. Under Connection, ensure Server URL is selected and enter the AI Identity Gateway’s MCP endpoint:
4
Configure OAuth with CIMD
Click Advanced OAuth settings to open the OAuth configuration panel. Ensure Authentication is set to OAuth and that the Registration method shows Client Identifier Metadata Document (CIMD). ChatGPT selects both automatically based on what the Auth Provider supports.
5
Acknowledge the risk warning and create the app
Check the I understand and want to continue box, then click Create. ChatGPT saves the app as a draft.
6
Publish the app
In the Drafts tab, click Publish next to your app. Review and acknowledge each security risk section, check both confirmation boxes, and click Publish to confirm.The app moves to the Enabled tab with a CUSTOM label and becomes visible to all workspace members.
- In ChatGPT, click Plugins in the left sidebar.
- Click the workspace tab (your organization’s name) to see apps published by your admin.
- Find the AI Identity Gateway app and click + to install it.
- Complete the OAuth flow — authenticate with your identity provider when prompted.
Verify the Connection
After connecting, verify that ChatGPT can discover and invoke tools from the AI Identity Gateway.- Check tool discovery — Ask ChatGPT to list available tools. ChatGPT should display the MCP tools exposed by your MCP Bridge and MCP Proxy apps.
- Invoke a tool — Ask ChatGPT to call one of the discovered tools. The AI Identity Gateway authenticates the request, evaluates authorization policies, performs token exchange, and returns the result.
- Check the Orchestrator logs — The AI Identity Gateway Orchestrator logs show the complete request flow: agent authentication, OPA policy evaluation, token exchange, and upstream API call. Verify that all steps completed successfully.
If ChatGPT cannot discover tools or tool invocations fail, see the troubleshooting
sections in the Expose APIs to Agents
and Protect MCP Servers guides.