Skip to content

docs(aigw): MCP OAuth in SCM needs 2.22.0, and what "Error Code: 03" during registration means - #1094

Open
vrv-panw wants to merge 1 commit into
mainfrom
docs/prisma-airs-updates
Open

vrv-panw wants to merge 1 commit into
mainfrom
docs/prisma-airs-updates

Conversation

@vrv-panw

Copy link
Copy Markdown
Contributor

A self-hosted SCM POC (AKS, CIE with Entra ID, gateway 2.21.0) couldn't get MCP OAuth 2.1 working: API-key access worked, and OAuth failed before any login page opened. Two things in the docs would have let them fix it themselves.

Changes

aigw/product/mcp-gateway/authentication/cas.mdx

  • New prerequisite 1: gateway 2.22.0 or later. On 2.21.0, GET /oauth/<slug>/authorize returns 500 {"status":"failure","message":"immutable"}, so the flow stops between client registration and the CAS login page. 2.22.0 fixed it (see the 2026-09-11 changelog entry).
  • Two troubleshooting rows: the 2.21.0 500, and the Error Code: 03 registration failure below.

aigw/help-center/mcp-gateway-troubleshooting.mdx

  • New section, Client registration fails with "Invalid API Key. Error Code: 03". That body comes from the AI Gateway: the MCP Gateway's /.well-known/*, /oauth/register and OPTIONS need no API key, and its own rejection is {"error":"unauthorized"} with WWW-Authenticate. The section gives three checks (discovery URLs, a test registration, the same request from inside the pod) and the fixes: MCP_GATEWAY_BASE_URL, routing every path on the MCP host to 8788 under SERVER_MODE=all, or SERVER_MODE=unified.
  • One paragraph on the unified-mode URL layout: servers under /m, discovery and OAuth at the root. Only the changelog mentioned this before, and it reads as if everything moves under /m.

How this was verified

Against a live self-hosted gateway (gateway_enterprise, unified mode), with no API key on any request:

Request 2.21.0 2.22.0
GET /.well-known/oauth-authorization-server 200 200
OPTIONS /oauth/register 204 + CORS —
POST /oauth/register 201 (also 201 with a bogus Authorization or x-portkey-api-key) 201
GET /oauth/<slug>/authorize 500 immutable 200, redirect to cloud-auth.us.apps.paloaltonetworks.com
POST to a non-MCP path 401 Invalid API Key. Error Code: 03 —

Not verified: SERVER_MODE=mcp / all on 8788. The in-pod check in the new section is there to tell a routing fault from a mode-specific one.

Checks

mint validate passes. mint broken-links --check-anchors flags nothing new; the three anchors it reports on the troubleshooting page are pre-existing and also appear on the non-aigw copy.

🤖 Generated with Claude Code

…during registration means

Two gaps a self-hosted SCM POC hit in the field:

- cas.mdx listed no minimum gateway version. On 2.21.0 GET /oauth/<slug>/authorize
  returns 500 {"message":"immutable"}, so the flow dies between client registration
  and the CAS login page. Added as prerequisite 1 and a troubleshooting row.
- A client reporting "Dynamic Client Registration rejected (HTTP 401)" with
  "Invalid API Key. Error Code: 03" is talking to the AI Gateway, not the MCP
  Gateway, whose /oauth/register takes no API key. The troubleshooting page now
  says how to tell the two apart, how to confirm from inside the pod, and the
  base-URL / routing / unified-mode fixes. It also notes that unified mode keeps
  /.well-known and /oauth at the root while servers move under /m.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
portkey-docs 🟢 Ready View Preview Sep 24, 2026, 5:35 AM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Clarify unified-mode /m URLs and the gateway 2.22.0+ requirement.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Documents MCP OAuth prerequisites and troubleshooting for self-hosted gateways.

Changes:

  • Requires gateway 2.22.0+ for SCM CAS OAuth.
  • Adds Error Code 03 registration diagnostics and routing checks.
  • Clarifies unified-mode URL behavior.
File Summary
aigw/​product/​mcp-gateway/​authentication/​cas.mdx Adds version requirements and OAuth troubleshooting entries.
aigw/​help-center/​mcp-gateway-troubleshooting.mdx Adds registration diagnostics and deployment guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

3. **Set `MCP_GATEWAY_BASE_URL`** to your public gateway URL (for example `https://<your-gateway-host>`). The gateway uses this to construct callback and discovery URLs—if it's wrong, OAuth and discovery fail.
4. Make sure your ingress forwards the `Host` header so the server advertises its public URL (not an internal address).

With `SERVER_MODE=unified` (gateway 2.20.0 or later), both gateways share one port: MCP servers are at `https://<your-gateway-host>/m/{slug}/mcp`, while `/.well-known/*` and `/oauth/*` stay at the root, not under `/m`.

This branch was successfully deployed

1 active deployment
staging — b8c99f07 Deployed Sep 24, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants