Skip to content

Custom connector OAuth flow fails with "code: Field required" — auth orchestration never reaches server endpoints #212

Description

@mattlanc89

Description

Custom MCP connector added via claude.ai org settings fails to complete OAuth authentication. The MCP server correctly implements RFC 9728 discovery and all OAuth endpoints, but Claude's auth orchestration fails internally before reaching the server's /authorize or /token endpoints.

Setup

  • Remote MCP server with OAuth 2.1 via external OIDC provider (Auth0)
  • mcp-gate (RFC 9728 compliance proxy) in front of MCP server
  • Server correctly serves /.well-known/oauth-protected-resource with valid authorization server reference
  • Auth server correctly serves /.well-known/oauth-authorization-server with all required endpoints
  • DCR enabled and tested (curl to /register returns valid client credentials)
  • PKCE supported, RS256 JWT tokens configured
  • Domain-level connection enabled for DCR-created apps

What Works

  • /.well-known/oauth-protected-resource returns 200 with correct metadata
  • /sse returns 401 without auth (correct — JWT validation at proxy layer)
  • /authorize returns 302 redirect to OIDC provider
  • /token proxies to OIDC token endpoint
  • /register returns 201 with client credentials
  • Claude Code CLI connects to the same server successfully via claude mcp add --transport http

What Fails

  1. Add custom connector in org settings with server URL only (no OAuth fields — expects DCR)
  2. Also tried with pre-registered Client ID + Client Secret in Advanced Settings
  3. Both cases: Claude discovers the resource metadata (200) and correctly gets 401 on /sse
  4. Then Claude's auth orchestration fails with:
    {"type":"error","error":{"type":"invalid_request_error","message":"code: Field required"}}
  5. Server logs show no /authorize, /token, or /register requests from Claude-User
  6. The error originates from claude.ai/api/organizations/.../mcp/start-auth/...

Reference IDs

  • ofid_c35011d59c070440
  • req_011CaKR4coGASHxaq5aBLSQ2
  • req_011CaKRJzHy8cynDZemSMPBq
  • req_011CaKRcm21jmdw8gtQJ4W

Expected Behavior

After discovering /.well-known/oauth-protected-resource and receiving 401, Claude should complete the standard OAuth flow (fetch AS metadata → DCR or use pre-registered creds → authorize → token → attach Bearer). All steps work manually. Claude stops between discovery and authorization.

Potentially Related Issues

Environment

  • claude.ai web + Team plan
  • Custom connector via org settings
  • Claude Code CLI works with same server URL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions