Skip to content
Latest (currently 2026.11.0) has the newest features, bug fixes, and CVE patches of Solo Enterprise for agentgateway.

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

MCP consent screen

Page as Markdown

Show users a gateway-hosted consent screen before completing the brokered OAuth flow.

About

The MCP consent screen is a page that the OAuth issuer shows during brokered elicitation. The issuer shows the page after the user signs in to your identity provider (IdP), and before the issuer starts the upstream OAuth authorization. The user must accept the page to continue.

This page is separate from the consent screen that the upstream OAuth provider shows, such as GitHub, Slack, or Salesforce. Use the gateway page when your organization needs its own consent step in addition to the provider’s authorization page. A security review is one reason to add that step.

How consent fits into the brokered flow

The OAuth issuer renders the page in the Solo Enterprise for agentgateway control plane. The page sits between the downstream login and the upstream authorization. If the user accepts, the flow continues to the upstream provider. If the user dismisses the page, the issuer does not get an upstream token.

The MCP client’s browser uses the gateway’s public URL. The proxy forwards /oauth-issuer requests to the control plane, where the issuer and the consent screen template run. For the full chained flow, see About brokered elicitation.

Consent persistence

The gateway records a consent grant for the user and the backend. The grant key is the user’s downstream identity and the backend that the user authorized. By default, that identity is the sub claim of the ID token. To select another claim, see Elicitation owner claim. The grant lasts as long as the refresh token from the same flow. While that refresh token is valid, the user does not see the consent screen again, even after the user closes the MCP client and opens the client again.

When the refresh token expires, or when your IdP revokes the token, the next connection starts a new chained flow. The user sees the consent screen again.

To show the consent screen on every authentication, set consent.force_refresh to true in the KGW_OAUTH_ISSUER_CONFIG configuration. Use force_refresh when your security policy requires consent on every authorization.

Before you begin

  1. Complete Set up brokered elicitation. Reuse its issuer client, route, keycloak-jwks backend, and Helm values files. Keep GATEWAY_NAME, GATEWAY_URL, and KEYCLOAK_ISSUER exported.
  2. Install Node.js 22.19 or later to run MCP Inspector.
  3. Have an Atlassian account that can authorize the upstream MCP server.

Step 1: Enable consent on the shared issuer

The shared setup already configures downstream login and exposes the issuer. Add consent settings to that issuer. The resource configuration in Step 2 selects the upstream provider.

  1. Open brokered-values.yaml from the setup guide. Add the following consent property at the top level of the JSON in controller.extraEnv.KGW_OAUTH_ISSUER_CONFIG. Retain downstream_server, gateway_config, and incoming_clients, and add a comma between the existing final property and consent.

    "consent": {
      "enabled": true,
      "force_refresh": false,
      "platform_name": "Acme AI Gateway powered by Solo Enterprise for agentgateway",
      "logo_url": "https://agentgateway.dev/agw-dark.svg",
      "legal_text": "By clicking Continue, you authorize Acme AI Gateway to act on your behalf against the selected upstream service. Acme will store an access token tied to your identity until it is revoked or expires."
    }
    SettingDescription
    enabledEnables the consent screen for resources with upstream OAuth. Downstream-only resources skip the screen.
    force_refreshSet to true to ask for consent each time. With false, a valid stored consent can be reused.
    platform_nameDisplay name shown on the consent screen. Required when consent is enabled.
    logo_urlOptional image URL that the user’s browser can reach.
    legal_textOptional plain-text description of the authorization.
  2. Upgrade the controller with both values files and wait for the rollout.

    helm upgrade -i enterprise-agentgateway oci://us-docker.pkg.dev/solo-public/enterprise-agentgateway/charts/enterprise-agentgateway \
      -n agentgateway-system \
      --version v2026.11.0 \
      -f values.yaml -f brokered-values.yaml
    kubectl -n agentgateway-system rollout status deployment/enterprise-agentgateway

Step 2: Configure consent for a backend

Each consent-eligible MCP backend is configured by an EnterpriseAgentgatewayPolicy that uses the brokered elicitation flow. You put consent screen overrides directly into typed fields on the policy to change the platform name, logo, or legal text just for that backend.

Note

In earlier releases, the per-backend upstream OAuth configuration and consent overrides were stored in an opaque elicitation Secret (with keys such as base_url, mcp_resource, scopes, client_name, consent_platform_name, consent_logo_url, consent_legal_text, and consent_disabled) that the policy referenced by name. In recent releases, these values are expressed as typed fields under backend.entElicitation.brokered, and the per-backend consent overrides live under brokered.chainedAuth.oauth.consent. Only an upstream OAuth client secret (for a statically registered client) is stored in a Secret, referenced with clientSecretRef. For the full field mapping, see the elicitation overview.

  1. Create an AgentgatewayBackend for the Atlassian MCP server that protects traffic to the server with the downstream IdP. The agentgateway.dev/issuer-proxy value in resourceMetadata tells MCP clients to discover the authorization server through the gateway’s OAuth issuer, which is where the consent screen is served. The authentication block validates inbound JWTs from the downstream IdP against the keycloak-jwks backend from brokered setup.

    kubectl apply -f- <<EOF
    apiVersion: agentgateway.dev/v1alpha1
    kind: AgentgatewayBackend
    metadata:
      name: mcp-atlassian
      namespace: agentgateway-system
    spec:
      mcp:
        targets:
          - name: mcp-target
            static:
              path: /mcp/atlassian
              host: mcp.atlassian.com
              port: 443
      policies:
        tls: {}
        mcp:
          authentication:
            mode: Strict
            issuer: "${KEYCLOAK_ISSUER}"
            audiences:
              - agw-issuer
            jwks:
              backendRef:
                name: keycloak-jwks
                group: agentgateway.dev
                kind: AgentgatewayBackend
              cacheDuration: 24h
              jwksPath: /realms/downstream-mcp/protocol/openid-connect/certs
            resourceMetadata:
              agentgateway.dev/issuer-proxy: "http://enterprise-agentgateway.agentgateway-system.svc.cluster.local:7777/oauth-issuer"
              authorizationServers:
                - "${GATEWAY_URL}/mcp/atlassian"
              resource: "${GATEWAY_URL}/mcp/atlassian"
    EOF
  2. Create an EnterpriseAgentgatewayPolicy that configures the brokered elicitation flow for the Atlassian backend. The brokered.chainedAuth.oauth fields define the upstream OAuth provider, and the consent block overrides the controller-level logo and legal text just for this backend. The entTokenExchange.solo.elicitation field wires the data plane to the built-in controller STS for this backend.

    kubectl apply -f- <<EOF
    apiVersion: enterpriseagentgateway.solo.io/v1alpha1
    kind: EnterpriseAgentgatewayPolicy
    metadata:
      name: mcp-atlassian-elicit
      namespace: agentgateway-system
    spec:
      targetRefs:
        - group: agentgateway.dev
          kind: AgentgatewayBackend
          name: mcp-atlassian
      backend:
        entElicitation:
          brokered:
            mcpResourcePath: /mcp/atlassian
            chainedAuth:
              oauth:
                baseUrl: https://mcp.atlassian.com
                scopes:
                  - read:jira-work
                  - read:confluence-content.summary
                  - offline_access
                clientName: Atlassian
                consent:
                  logoUrl: https://upload.wikimedia.org/wikipedia/commons/thumb/7/72/Atlassian-horizontal-blue-rgb.svg/3840px-Atlassian-horizontal-blue-rgb.svg.png
                  legalText: By clicking Continue, you authorize Acme AI Gateway to read your Jira issues and Confluence pages on your behalf.
        entTokenExchange:
          solo:
            elicitation: {}
    EOF

    Review the following table to understand this configuration. For more information, see the API docs.

    FieldDescription
    brokered.mcpResourcePathThe MCP path that the gateway protects. Must match the protected resource metadata on the backend and the path on the HTTPRoute.
    brokered.chainedAuth.oauth.baseUrlOAuth metadata discovery URL for the upstream OAuth provider. The gateway resolves the authorization, token, and dynamic client registration URLs from the provider’s metadata. For the discovery URLs that the gateway tries and for PKCE with a confidential client, see the OAuth issuer settings. To use a statically registered client instead of discovery, set clientId, authorizeUrl, and accessTokenUrl (and clientSecretRef for a confidential client) instead of baseUrl.
    brokered.chainedAuth.oauth.scopesUpstream OAuth scopes, as a list.
    brokered.chainedAuth.oauth.clientNameOptional. Human-friendly client name used during Dynamic Client Registration and shown on the consent screen when consent.platformName is not set.
    brokered.chainedAuth.oauth.consent.disabledOptional. Set to true to opt this backend out of the consent screen even when controller-level consent is enabled. See Step 4.
    brokered.chainedAuth.oauth.consent.platformNameOptional. Overrides KGW_OAUTH_ISSUER_CONFIG.consent.platform_name for this backend.
    brokered.chainedAuth.oauth.consent.logoUrlOptional. Overrides the controller-level logo URL for this backend.
    brokered.chainedAuth.oauth.consent.legalTextOptional. Overrides the controller-level legal text for this backend. Plain text only.
    entTokenExchange.solo.elicitationWires the data plane to perform elicitation token exchange against the built-in controller STS for this backend.
  3. Verify that the policy attached to the backend.

    kubectl -n agentgateway-system get enterpriseagentgatewaypolicy mcp-atlassian-elicit \
      -o jsonpath='{.status.ancestors[0].conditions}' | jq

    Example output:

    {
      "lastTransitionTime": "2026-05-18T17:09:14Z",
      "message": "Policy accepted",
      "observedGeneration": 1,
      "reason": "Valid",
      "status": "True",
      "type": "Accepted"
    },
    {
      "lastTransitionTime": "2026-05-18T17:09:14Z",
      "message": "Attached to all targets",
      "observedGeneration": 1,
      "reason": "Attached",
      "status": "True",
      "type": "Attached"
    }
  4. Create an HTTPRoute to the Atlassian backend. The route matches the MCP path and the two OAuth well-known paths so MCP clients can complete the discovery handshake before sending any MCP traffic.

    kubectl apply -f- <<EOF
    apiVersion: gateway.networking.k8s.io/v1
    kind: HTTPRoute
    metadata:
      name: mcp-atlassian
      namespace: agentgateway-system
    spec:
      parentRefs:
        - group: gateway.networking.k8s.io
          kind: Gateway
          name: ${GATEWAY_NAME}
          namespace: agentgateway-system
      rules:
        - matches:
            - path:
                type: PathPrefix
                value: /mcp/atlassian
            - path:
                type: PathPrefix
                value: /.well-known/oauth-protected-resource/mcp/atlassian
            - path:
                type: PathPrefix
                value: /.well-known/oauth-authorization-server/mcp/atlassian
          backendRefs:
            - group: agentgateway.dev
              kind: AgentgatewayBackend
              name: mcp-atlassian
              weight: 1
    EOF

Step 3: Verify the consent screen

Use MCP Inspector 2.9.0 to complete downstream login, review the consent screen, and authorize the upstream provider.

  1. Start the Inspector.

    npx -y @modelcontextprotocol/inspector@2.9.0
  2. Open http://localhost:6274 or the http://127.0.0.1:6274 URL from the startup output. Click Add Servers > Add manually. Set the server ID to mcp-atlassian, select streamable-http, and use the following URL, then click Add.

    echo "${GATEWAY_URL}/mcp/atlassian"
  3. Turn on the connection switch for mcp-atlassian. The browser redirects to Keycloak. Sign in as alice with password alice-password.

  4. Review the gateway’s consent screen and click Continue. The per-resource settings from Step 2 override the issuer’s default logo and legal text.

  5. Complete the Atlassian authorization flow. Select the applications to authorize and approve access.

  6. Verify that the Inspector returns to Connected and lists the Atlassian tools. The stored consent is associated with alice and the mcp-atlassian backend; subsequent connections can reuse that consent until it expires.

Step 4: Opt a backend out

When controller-level consent is enabled, every consent-eligible backend shows the consent screen by default. To skip the consent screen for a specific backend, you can opt a backend out. This is useful for internal services where explicit consent is not required by policy.

Create an EnterpriseAgentgatewayPolicy for the backend that you want to opt out, and set brokered.chainedAuth.oauth.consent.disabled to true. Connections to that backend complete dual OAuth without rendering the consent screen. This example assumes an mcp-internal AgentgatewayBackend that you set up the same way as the Atlassian backend in Step 2.

kubectl apply -f- <<EOF
apiVersion: enterpriseagentgateway.solo.io/v1alpha1
kind: EnterpriseAgentgatewayPolicy
metadata:
  name: mcp-opt-out-consent
  namespace: agentgateway-system
spec:
  targetRefs:
    - group: agentgateway.dev
      kind: AgentgatewayBackend
      name: mcp-internal
  backend:
    entElicitation:
      brokered:
        mcpResourcePath: /mcp/internal
        chainedAuth:
          oauth:
            baseUrl: https://mcp.internal.example.com
            scopes:
              - openid
              - profile
            clientName: Internal Tools
            consent:
              disabled: true
    entTokenExchange:
      solo:
        elicitation: {}
EOF

Cleanup

Remove this guide’s backend and policy when you finish the consent example. Keep the shared issuer and IdP while another brokered guide uses them.

  1. Disconnect and remove mcp-atlassian in the Inspector. Press Ctrl+C in the Inspector terminal, then delete the backend resources.

    kubectl delete httproute mcp-atlassian -n agentgateway-system
    kubectl delete enterpriseagentgatewaypolicy mcp-atlassian-elicit -n agentgateway-system
    kubectl delete agentgatewaybackend mcp-atlassian -n agentgateway-system
  2. If you created the opt-out policy in Step 4, delete it.

    kubectl delete enterpriseagentgatewaypolicy mcp-opt-out-consent -n agentgateway-system
  3. To disable shared consent, set consent.enabled to false in brokered-values.yaml and repeat the Helm upgrade from Step 1. If all brokered examples are complete, clean up the shared infrastructure.