For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
OAuth issuer settings
Reference for the OAuth issuer settings of brokered elicitation, including the downstream IdP, client authentication, upstream OAuth providers, and optional issuer features.
Use this reference to look up the OAuth issuer settings for brokered elicitation. The reference covers four groups: the issuer settings that you set one time, client authentication on each leg of the flow, the upstream OAuth provider for each MCP resource, and the optional issuer features. Use the reference when you adapt the setup example to your own identity provider (IdP), upstream providers, and MCP clients.
Some settings also appear in the guides where you first use them. For a working example, see Set up brokered elicitation. For how the issuer uses these settings, see About brokered elicitation.
Where each setting lives
Brokered elicitation has settings at two levels.
- Issuer settings apply to every MCP resource that the issuer handles. Those settings cover the downstream IdP, the public issuer URL, the MCP clients that can connect, and optional features such as the consent screen.
- Resource settings apply to one MCP resource: its MCP path and, for the chained flow, its upstream OAuth provider.
The settings have the same names in both modes. Only their location and format differ.
| Setting | Kubernetes | Standalone |
|---|---|---|
| Issuer settings | The KGW_OAUTH_ISSUER_CONFIG controller environment variable, as a JSON string, in the controller.extraEnv Helm value. Keys use snake case, such as client_id. | The entSts.oauthIssuer section of the configuration file, as YAML. Keys can use camel case, such as clientId, or snake case. |
| Resource settings | backend.entElicitation.brokered in an EnterpriseAgentgatewayPolicy that targets the MCP backend | entSts.entElicitations.resources.<key>.brokered |
| The declaration that the issuer handles an MCP path | mcp.authentication.resourceMetadata on the MCP backend | mcpAuthentication.resourceMetadata on the MCP route |
| The connection from the backend to the STS | backend.entTokenExchange.solo.elicitation in the same EnterpriseAgentgatewayPolicy | backendAuth.oauthTokenExchange on the MCP backend, with the path /elicitations/oauth2/token |
| Secrets and key pairs | References to Kubernetes Secrets in the same namespace | Inline values, or {file: <path>} references |
Warning
The two modes check unknown keys differently. Standalone mode refuses to start when entSts.oauthIssuer contains an unknown key. Standalone mode also refuses to start when the same key appears in both spellings. In Kubernetes mode, the controller ignores unknown keys in KGW_OAUTH_ISSUER_CONFIG and does not report an error. Do not copy camel-case keys from a standalone configuration into the environment variable. For example, an allowedRedirectUris key in the environment variable has no effect. The issuer then accepts any redirect URI.
Issuer settings
The following example shows the issuer settings that most deployments use. Replace the example URLs and client credentials with the values for your gateway and IdP.
Add the settings to the Helm values of the controller, and upgrade the release. The controller reads the variable when it starts, so the upgrade restarts the controller. Other Helm values, such as tokenExchange.enabled, are also required. For the complete values, see Set up brokered elicitation.
controller:
extraEnv:
KGW_OAUTH_ISSUER_CONFIG: |
{
"gateway_config": {
"base_url": "https://gateway.example.com/oauth-issuer"
},
"downstream_server": {
"name": "corporate-idp",
"client_id": "agw-issuer",
"client_secret": "<client-secret>",
"authorize_url": "https://idp.example.com/oauth2/authorize",
"token_url": "https://idp.example.com/oauth2/token",
"scopes": ["openid", "profile", "offline_access"]
},
"incoming_clients": {
"allowed_redirect_uris": [
"http://localhost:6274/oauth/callback",
"http://localhost:6274/oauth/callback/debug"
]
},
"consent": {
"enabled": true,
"platform_name": "Example AI Gateway"
}
}The issuer settings have the following sections. The sections that are not in the example are optional.
| Section | Required | Description |
|---|---|---|
gateway_config | Yes | The public issuer URL. See Gateway URL. |
downstream_server | Yes | Your IdP, and the client that the issuer uses to log users in. See Downstream server. |
incoming_clients | No, but recommended | The redirect URIs that MCP clients can use. See Client authentication. |
client_id_metadata | No | Lets MCP clients identify themselves with a client ID metadata document. See Client ID metadata documents. |
consent | No | The consent screen that the issuer shows before the upstream authorization. See Consent screen. |
par_config | No | Pushed authorization requests. See Pushed authorization requests. |
pre_issuance | No | An external authorization check before the issuer completes a login. See Pre-issuance authorization. |
upstream_client_id_metadata | No | A client ID metadata document that identifies the gateway to upstream providers. See Upstream client identity. |
Gateway URL
The gateway_config.base_url setting is the public URL of the issuer, such as https://gateway.example.com/oauth-issuer. The issuer builds every published URL from this value. Those URLs include the issuer metadata, the issuer endpoints, and the callback URLs that you register with your IdP and with upstream providers. The issuer never builds a URL from the request headers.
- Use the URL that MCP clients and browsers use to reach the gateway, including the port if it is not the default.
- The path must be
/oauth-issuer, because the issuer serves its endpoints under that path. The gateway route must forward the path without a rewrite. - The URL must be absolute. The issuer refuses to start when the value is missing or relative.
Downstream server
The downstream_server section describes your IdP and the client that the issuer uses to log users in. Register this client with your IdP, with the redirect URI <base_url>/callback/downstream. A confidential client, with a secret or a key pair, is the usual choice. The issuer reads the user’s identity from the ID token, so the IdP must support OpenID Connect.
| Setting | Required | Description |
|---|---|---|
name | Yes | A label for the IdP, used in logs. |
client_id | Yes | The client ID that you registered with the IdP. The issuer also gives this client ID to MCP clients. See Client authentication. |
client_secret | No | The client secret that you registered with the IdP. The issuer sends it in the token request body. Omit it for a public client. |
certificate_key_pair_ref | No | Kubernetes only. The name and namespace of a Secret that has a PEM key pair in the tls.key and tls.crt keys. The issuer signs a JWT client assertion with the key instead of sending a client secret. The assertion format is for Microsoft Entra ID. The controller reads the Secret when it starts, so restart the controller after you rotate the certificate. Mutually exclusive with client_secret. |
authorize_url | Yes | The IdP’s authorization endpoint. The issuer does not use discovery for the downstream server. |
token_url | Yes | The IdP’s token endpoint. |
scopes | Yes | The scopes to request, as a list. The issuer adds openid if the list does not have it. Add offline_access, or your IdP’s equivalent, so that MCP clients get a refresh token. |
pkce | No | When the issuer sends PKCE to the IdP. always, the default, sends PKCE also with client authentication. public_only sends PKCE only when the client has no secret or key pair. Use public_only only for an IdP that rejects PKCE from a confidential client. |
user_id_claim | No | Do not set. Credentials that the brokered flow stores under this claim do not match the token exchange lookup. Use the AGW_ELICITATION_USER_ID_CLAIM environment variable instead. See User identity. |
The other keys that the server shape accepts, such as base_url, registration_url, and client_name, apply only to upstream OAuth providers. The issuer does not use them for the downstream server.
User identity
The issuer stores each upstream credential for one user and one MCP resource. The user identity comes from a claim in the downstream ID token, which is sub by default.
To use another claim, such as oid, set the AGW_ELICITATION_USER_ID_CLAIM environment variable on the STS. This variable also applies to interactive elicitation. Do not use the older downstream_server.user_id_claim setting. That setting applies to the brokered flow only, so the flow stores credentials under that claim, but token exchange looks up credentials under sub and never finds them. Remove the older setting when you set the variable. If you set both, they must have the same value, or the STS refuses to start.
For where to set the variable, how to choose a claim, and what changes when you upgrade, see Elicitation owner claim.
Caution
Changing the identity claim changes the key of every stored credential. Users must authorize again, and logins that are in progress fail with an error that tells the user to restart authorization. Do not select a claim that users can edit, such as an unverified email claim, because a user who changes the value can reach another user’s stored credentials.
The claim must have the same value in the ID token and in the access token that the MCP client sends to the gateway. The proxy looks up the stored credential with the access token. If the two values differ, the lookup never finds the credential.
Client authentication
Three clients authenticate in a brokered flow, one for each leg.
| Leg | Client | How the client authenticates |
|---|---|---|
| MCP client to the issuer | The MCP client | With the downstream client ID, as a public client with PKCE or as a confidential client with the downstream client secret. Or with a client ID metadata document. See MCP clients. |
| Issuer to the downstream IdP | The issuer | With downstream_server.client_secret, certificate_key_pair_ref, or no credential. PKCE is on by default. See Downstream server. |
| Issuer to the upstream provider | The issuer | With a client that you register, a client that the issuer registers dynamically, or the gateway’s client ID metadata document. See Upstream client identity. |
MCP clients
The issuer has one client registration for MCP clients: the downstream_server.client_id value. An MCP client can get and use that client ID in the following ways.
| Method | How it works |
|---|---|
| Dynamic client registration | The client sends its redirect URIs to /register. The issuer checks each URI against the allowlist and returns the downstream client ID with token_endpoint_auth_method: none. The client is a public client, and it must use PKCE with the S256 method. The issuer does not store the registration. Most MCP clients, such as MCP Inspector, use this method. |
| Preconfigured public client | You give the client the downstream client ID. The client uses PKCE with the S256 method and sends no secret. |
| Preconfigured confidential client | You give the client the downstream client ID and secret. The client sends the secret to /token with HTTP Basic authentication (client_secret_basic) or in the request body (client_secret_post). The issuer advertises these methods only when downstream_server.client_secret is set. |
| Client ID metadata document | The client uses an HTTPS URL as its client ID. The issuer gets the document from that URL. See Client ID metadata documents. |
Because every registered client shares the downstream client ID, the redirect URI allowlist is the setting that controls where the issuer can send an authorization code.
| Setting | Description |
|---|---|
incoming_clients.allowed_redirect_uris | The redirect URIs that clients with the downstream client ID can use. /register, /authorize, and /par reject a URI that is not in the list. When the list is empty, the issuer accepts any redirect URI and logs a warning at startup. List every URI that a client registers, such as both /oauth/callback and /oauth/callback/debug for MCP Inspector. |
For the matching rules, see Redirect URI allowlist.
Client ID metadata documents
A client ID metadata document (CIMD) lets a public MCP client identify itself with an HTTPS URL instead of a registration. The issuer gets the JSON document at that URL, and checks that the requested redirect URI is in the document. The allowlist in incoming_clients does not apply to CIMD clients.
| Setting | Description |
|---|---|
client_id_metadata.enabled | Accept client ID metadata documents. The default is false. |
client_id_metadata.trusted_domains | The hosts that can serve a document, such as clients.example.com or *.example.com. Use host names only, without a scheme or port. A wildcard matches one label. When the list is empty, the issuer gets documents from any public host and logs a warning. The issuer never gets a document from a private or special-use IP address. |
CIMD clients have the following limits.
- The client must use PKCE with the
S256method, and cannot use a client secret. - The issuer does not return a refresh token to a CIMD client, and rejects a
refresh_tokengrant from one. The user logs in again when the token expires.
Upstream OAuth provider
The upstream OAuth provider is the authorization server that issues each user’s access token for an upstream service, such as GitHub or Atlassian. It is not an identity provider: the issuer gets no ID token from it. You configure it for each MCP resource in brokered.chainedAuth.oauth. A resource without chainedAuth uses the downstream-only flow.
Register the gateway with the upstream provider with the redirect URI <base_url>/callback/upstream, unless the issuer registers itself dynamically.
The following example uses a client that you registered with the provider, with explicit endpoints. The client secret is in the github-oauth Secret, in the client_secret key.
apiVersion: enterpriseagentgateway.solo.io/v1alpha1
kind: EnterpriseAgentgatewayPolicy
metadata:
name: mcp-github-elicit
namespace: agentgateway-system
spec:
targetRefs:
- group: agentgateway.dev
kind: AgentgatewayBackend
name: mcp-github
backend:
entElicitation:
brokered:
mcpResourcePath: /mcp/github
chainedAuth:
oauth:
clientId: Iv1.0123456789abcdef
clientSecretRef:
name: github-oauth
authorizeUrl: https://github.com/login/oauth/authorize
accessTokenUrl: https://github.com/login/oauth/access_token
scopes: [repo, read:user]
clientName: GitHub
entTokenExchange:
solo:
elicitation: {}For a complete example with a backend and route, see Configure consent for a backend.
| Setting | Description |
|---|---|
mcpResourcePath | Required. The MCP path that the issuer protects, such as /mcp/github. Use the path only, not the full URL. The value must start with / and match the path in the resource metadata. |
chainedAuth.oauth.baseUrl | The provider URL for metadata discovery. The issuer gets the authorization, token, and registration endpoints from the provider’s metadata. Set baseUrl alone, or set authorizeUrl and accessTokenUrl together. |
chainedAuth.oauth.authorizeUrl | The provider’s authorization endpoint. Set together with accessTokenUrl. |
chainedAuth.oauth.accessTokenUrl | The provider’s token endpoint. Set together with authorizeUrl. |
chainedAuth.oauth.registrationUrl | The provider’s dynamic client registration endpoint. Use it with explicit endpoints and no clientId. Not allowed with baseUrl. |
chainedAuth.oauth.clientId | The client ID that you registered with the provider. Omit it to let the issuer register a client dynamically. |
chainedAuth.oauth.clientSecretRef | The Secret that has the client secret. Set name, and optionally key. When you omit key, the controller uses the client_secret key, or the clientSecret key if client_secret does not exist. Requires clientId. |
chainedAuth.oauth.certificateKeyPairRef | The name of a Secret that has a PEM key pair in the tls.key and tls.crt keys, for a JWT client assertion. The assertion format is for Microsoft Entra ID. Requires clientId. Mutually exclusive with clientSecretRef and with registrationUrl. |
chainedAuth.oauth.scopes | The scopes to request from the provider, as a list. Include the scope that makes the provider issue a refresh token, such as offline_access, so that the STS can refresh the credential. |
chainedAuth.oauth.clientName | The name of the upstream service. The consent screen shows it, and the issuer sends it as client_name in a dynamic registration. Up to 128 characters. |
chainedAuth.oauth.pkce | When the issuer sends PKCE to the provider: Auto, the default, Always, or PublicOnly. See PKCE. |
chainedAuth.oauth.consent | Overrides of the consent screen for this resource: disabled, platformName, logoUrl, and legalText. See Consent screen. |
Upstream client identity
The issuer picks the client identity that it presents to the upstream provider in the following order.
| Configuration | Client identity |
|---|---|
clientId is set | The client that you registered. The issuer authenticates with the client secret, with the key pair, or as a public client with PKCE when neither is set. |
registrationUrl is set, without clientId | A client that the issuer registers at that URL. |
baseUrl only, upstream client ID metadata is on, and the provider advertises client_id_metadata_document_supported | The gateway’s own client ID metadata document. See the following table. |
baseUrl only, and the provider metadata has a registration_endpoint | A client that the issuer registers at that endpoint. |
The issuer registers one dynamic client for each MCP resource, stores the registration, and reuses it for every user. A key pair cannot be used with dynamic registration.
To identify the gateway with a client ID metadata document, turn on the issuer setting. The issuer then serves a public document at <base_url>/oauth/client-metadata.json, and uses that URL as its client ID with providers that support it.
| Setting | Description |
|---|---|
upstream_client_id_metadata.enabled | Serve the gateway’s document and use it with providers that support it. Requires an https base URL, because the document URL becomes a public client ID. The default is false. |
upstream_client_id_metadata.client_name | The client name in the document. The default is consent.platform_name, and then agentgateway. |
A provider that the issuer reaches through a client ID metadata document takes precedence over dynamic registration. Resources that use explicit endpoints instead of baseUrl cannot use this identity.
Discovery
With baseUrl, the issuer gets the provider metadata from the first of the following URLs that answers. For example, with the baseUrl value https://mcp.example.com/tenant:
https://mcp.example.com/.well-known/oauth-authorization-server/tenant(RFC 8414)https://mcp.example.com/tenant/.well-known/oauth-authorization-serverhttps://mcp.example.com/tenant/.well-known/openid-configuration
The issuer caches the metadata. When the metadata advertises support for the RFC 9207 iss parameter, the issuer checks that parameter on the upstream callback.
PKCE
The issuer always uses PKCE with an upstream client that has no secret and no key pair. For a client with credentials, the pkce setting decides.
| Value | Behavior |
|---|---|
Auto | The default. Use PKCE when the provider metadata advertises the S256 method. With explicit endpoints, the issuer has no metadata, so it does not use PKCE for a client with credentials. |
Always | Always use PKCE. Set this value with explicit endpoints when the provider requires PKCE. |
PublicOnly | Do not use PKCE for a client with credentials. Use it only for a provider that rejects PKCE from a confidential client. |
Before version 2026.9.1, the issuer did not use PKCE for an upstream client with credentials. After an upgrade, a client with credentials and a baseUrl uses PKCE if the provider advertises S256. To keep the earlier behavior, set pkce: PublicOnly.
The downstream pkce setting uses different values, always and public_only, because it is part of the issuer settings and not of the resource.
Optional issuer features
Consent screen
The consent screen is a gateway page that the user sees after the downstream login and before the upstream authorization. It applies only to resources with chainedAuth.
| Setting | Description |
|---|---|
consent.enabled | Show the consent screen. The default is false. |
consent.platform_name | The name of the party that asks for access. Required when enabled is true. |
consent.logo_url | The logo on the screen. Use an https URL. The issuer drops a URL with another scheme. |
consent.legal_text | Plain text that the screen shows below the request. |
consent.force_refresh | Show the screen also when the user already authorized the resource. The default is false. |
Each resource can override these values, or turn the screen off, in chainedAuth.oauth.consent. For the complete steps, see the consent screen guide.
Pushed authorization requests
With pushed authorization requests (PAR, RFC 9126), an MCP client sends its authorization parameters to /par in a back-channel request. The client then sends the user to /authorize with the request_uri value from that response. PAR is optional for clients. The issuer metadata always lists the /par endpoint. When PAR is off, that endpoint answers with a 400 response and the invalid_request error.
| Setting | Description |
|---|---|
par_config.enabled | Accept pushed authorization requests. |
par_config.ttl_seconds | How long a request_uri value is valid, in seconds. The default is 60. |
Pre-issuance authorization
The pre-issuance check calls an external authorization service after the user logs in to your IdP and before the issuer continues the flow. Use it to decide which users can connect to which MCP resources, with your own policy service. The issuer calls the service with the Envoy ext_authz gRPC API.
| Setting | Description |
|---|---|
pre_issuance.enabled | Run the check. The default is false. |
pre_issuance.grpc.target | Required. The address of the gRPC authorization service, such as ext-authz.example.com:9000. |
pre_issuance.grpc.insecure_disable_tls | Connect without TLS. The default is false. |
pre_issuance.grpc.timeout | The timeout for one check, as a duration such as 5s. The default is 15s. |
pre_issuance.grpc.metadata | Static gRPC metadata to send with each check, as key-value pairs. |
pre_issuance.grpc.forward_token | Send the user’s downstream access token in the check request. Set header, which is Authorization by default, and scheme, which is Bearer by default. When you omit forward_token, the issuer sends no token. |
pre_issuance.failure_policy | What to do when the service does not answer or returns an error: closed, the default, denies the login, and open allows it. |
pre_issuance.denied_redirect | Required. The absolute URL that the browser goes to when the check denies the login. The issuer adds the client_id, resource, and iss query parameters. |
The check request has the following values in its context extensions: user_id, resource, state, and, when the client sent them, client_id and redirect_uri.
Apply changes
- Issuer settings. The controller reads
KGW_OAUTH_ISSUER_CONFIGwhen it starts. A Helm upgrade that changes the value restarts the controller. - Resource settings. The controller applies changes to an EnterpriseAgentgatewayPolicy without a restart.
- Key pair for the downstream server. The controller reads the
certificate_key_pair_refSecret only when it starts. Register a new certificate with your IdP before you restart the controller. - Validation. The controller checks the issuer settings when it starts. If a setting is not valid, the controller does not start, and its log names the setting. The controller does not report unknown keys, so check the startup log line
OAuth issuer endpointsto confirm the base URL that the issuer uses.