OAuth Overview
Glean supports OAuth 2.1 for authenticating requests to the Client API and for connecting Model Context Protocol (MCP) host applications to Glean's Remote MCP Servers.
This guidance doesn't apply to the Indexing API.
Where OAuth applies at Glean
- Client API: OAuth is supported for REST access to search, chat, agents, and related endpoints.
- Remote MCP Servers: OAuth is supported and recommended. Use bearer token fallback only if the host application cannot perform OAuth.
- Indexing API: OAuth isn't supported. The Indexing API uses a different authentication mechanism with Glean-issued tokens.
Supported OAuth variants
- IdP-based OAuth (Authorization Code): Use access tokens issued by your enterprise Identity Provider (IdP) such as Google Workspace, Microsoft Entra ID/Azure AD, Okta, or OneLogin. Best fit for REST integrations when you already operate OAuth in your IdP. See OAuth with IdP‑issued tokens.
- Glean OAuth Authorization Server (Authorization Code + PKCE): Glean issues OAuth tokens with Glean-defined scopes to users signed in to Glean. If necessary, users are seamlessly directed to sign in with your SSO provider as part of the authorization process. Recommended for new REST integrations and required for the recommended MCP path. See Glean OAuth Authorization Server.
Proof Key for Code Exchange (PKCE) is an OAuth 2.0 extension (and required in OAuth 2.1) to prevent authorization code injection attacks. Learn more. Admins can configure redirect URI allowlisting to control which redirect URIs are permitted for OAuth clients.
Which OAuth approach should you choose?
| Consideration | Glean OAuth Authorization Server | IdP-based OAuth |
|---|---|---|
| Setup complexity | Simple. Configure entirely within Glean Admin console. | Complex. Requires registering OAuth app in your IdP, then configuring Glean to accept those tokens. |
| Who needs to be involved | Only Glean admins. | Glean admins + IdP admins. If you don't manage your IdP directly, expect coordination delays. |
| Time to get started | Fast. Enable in Admin console and register client apps immediately. | Slower. Depends on IdP team availability and approval processes. |
| Best for | New integrations, MCP connections, when you want quick deployment. | Existing OAuth infrastructure, centralized token governance, strict enterprise policies requiring all OAuth through IdP. |
| MCP support | Required for MCP Remote Servers. | Not suitable for MCP. |
| Token lifecycle | Managed by Glean. Issuance, expiry, and refresh handled by Glean's OAuth server. | Managed by your IdP. Aligns with existing enterprise token policies. |
| Scopes | Fine-grained Glean-defined scopes such as SEARCH, CHAT, AGENTS, and MCP. | User-scoped permissions; Glean enforces access based on user identity. |
| User authentication | Glean does not replace your SSO. Users authenticate via your existing SSO IdP (such as Google Workspace, Microsoft Entra ID, or Okta) using OIDC or SAML. Glean reuses your existing SSO configuration and only issues OAuth access tokens after successful authentication. No changes to your SSO setup required. | Users authenticate via your IdP's OAuth flow. |
Recommendation: Use Glean OAuth Authorization Server unless you have a specific requirement to centralize all OAuth token issuance in your IdP or existing IdP-based OAuth applications you want to extend to Glean.
What’s supported vs. not supported
| Category | Supported | Not supported |
|---|---|---|
| Grant types | Authorization Code with PKCE (OAuth 2.1 compliant) | Implicit; Resource Owner Password Credentials (ROPC) |
| Client API auth | HTTP Bearer tokens (OAuth access tokens) with required headers | OAuth for Indexing API |
| MCP Remote Servers | OAuth via Authorization Code; bearer token fallback if host cannot do OAuth |
Quick reference
Based on your choice, see the following links for setup instructions:
- IdP-based OAuth: See OAuth with IdP‑issued tokens for configuration steps.
- Glean OAuth Authorization Server: See Glean OAuth Authorization Server for setup instructions.
- MCP connections: Require the Glean OAuth Authorization Server. Follow your MCP host's OAuth configuration guide.
Static OAuth clients
The Glean OAuth Authorization Server supports static OAuth clients: admin-created applications with a stable client_id, explicitly configured redirect URIs, and an allowed set of scopes. Use these for partner integrations and customer-built internal applications. See Static OAuth clients.
To use static clients without allowing dynamic client registration, see Do not allow dynamic client registrations.
Dynamic OAuth clients
The Glean OAuth Authorization Server supports Dynamic Client Registration (DCR): clients register themselves at connection time instead of being pre-configured by an admin. DCR is the preferred approach for MCP host applications connecting to Glean, as defined by the MCP Authorization specification.
Client ID Metadata Documents
The Glean OAuth Authorization Server also supports Client ID Metadata Documents (CIMD). With CIMD, the client's client_id is an HTTPS URL that the client controls. That URL hosts a JSON document describing the client: its name, redirect URIs, grant types, and scopes. When the client connects, Glean fetches the document from that URL and uses it as the client's registration.
Compared with the other two approaches:
- Static clients require an admin to create the client in Glean and share a client ID and secret.
- Dynamic Client Registration lets the client register itself with Glean at connection time, which creates a new client record per registration.
- CIMD needs neither. The client publishes its metadata once at a stable URL, and every Glean deployment can verify it. Because the URL is tied to a domain the client vendor controls, the client identity is stable and cannot be spoofed by another application.
No Glean configuration is needed for CIMD. Applications that support it, such as Claude, connect with the Glean OAuth Authorization Server enabled. The Dynamic Client Registration setting controls CIMD browser sign-in: the redirect URI allowlist applies to CIMD clients, and Do not allow dynamic client registrations refuses them.
CIMD also removes the need for a static client in Enterprise Managed Auth.
CIMD support for deployments that also use ChatGPT or Codex with the Glean MCP server is coming soon.
For admin controls and full configuration steps, see Dynamic Client Registration.
If a CIMD document declares a localhost redirect URI without a port, such as http://localhost/callback, Glean accepts that redirect URI on whichever port the client listens on, such as http://localhost:3118/callback. This works for both public and confidential CIMD clients.
How CIMD clients authenticate
A metadata document sets token_endpoint_auth_method to tell Glean how the client authenticates at the token endpoint. Glean accepts two values:
token_endpoint_auth_method | Client type | How the client authenticates |
|---|---|---|
none | Public | PKCE only, with no client credentials. |
private_key_jwt | Confidential | A signed JWT client assertion (defined in Request for Comments (RFC) 7523), verified against public keys that the document publishes. |
Glean rejects a document that omits token_endpoint_auth_method or declares any other method, such as client_secret_post. A metadata document is public, so it has no place to keep a shared secret. Glean reads only token_endpoint_auth_method and ignores non-standard members such as token_endpoint_auth_methods_supported, so a private_key_jwt client is never treated as a public client.
A private_key_jwt document must also declare its keys and signing algorithm:
- Keys: Publish the public keys in exactly one of
jwks(inline) orjwks_uri(a URL that serves the key set). Ajwks_urimust use HTTPS, can't include user info or a fragment, and can't point to a private or local address. Glean uses only the public signing keys in the set. It ignores keys marked"use": "enc"and treats keys withoutuseas signing keys. - Signing algorithm: Set
token_endpoint_auth_signing_algtoRS256,RS384,RS512,ES256,ES384,ES512,PS256,PS384, orPS512. If the document omits it, Glean usesRS256. The OAuth Server Metadata lists the same values intoken_endpoint_auth_signing_alg_values_supported.
Each client assertion must:
- Be signed with the algorithm the document declares.
- Set
issandsubto the client'sclient_idURL. - Set
audto the Glean token endpoint,https://<instance>-be.glean.com/oauth/token. See OAuth endpoint URLs. - Include a
jti. Glean accepts each assertion only once and rejects a reused assertion withjti_known. - Set
expto a time in the future that's no more than 24 hours away.
Glean returns invalid_client when a confidential client's token request doesn't carry a valid assertion, including when Glean can't fetch the key set from the client's jwks_uri.
Enterprise Managed Auth
With Enterprise Managed Auth (EMA), you manage access to the Glean MCP server from your identity provider. You decide which AI application can reach Glean and which users or groups can use it. Users don't connect Glean themselves or sign in through a browser. The application presents a signed assertion from your identity provider, and Glean exchanges it for an access token. See Enterprise Managed Auth.
EMA gives security teams one place to govern MCP access and removes the per-user setup that slows deployment.
See also
- Enterprise Managed Auth
- Client API authentication overview
- OAuth (IdP tokens) developer guide
- Entra ID (OIDC) setup
- Google (OIDC) setup
- Okta (SAML) setup
- Generic SAML overview
- About Glean OAuth Server
- Dynamic Client Registration
- Static OAuth clients
- MCP Remote Server (overview/host configurator)
- MCP Server setup (admin enablement context)