OAuth Discovery · OAuth 2.1 + PKCE S256

RFC 8414 /.well-known/oauth-authorization-server Metadata Guide

Configure RFC 8414 Authorization Server Metadata for AI agents and MCP OAuth 2.1 clients: issuer validation, PKCE S256 enforcement, Dynamic Client Registration (RFC 7591), and CIMD.

Paste-to-Validate Manifest Linter

100% Client-Side
RFC 8414 OAuth Authorization Server Metadata
100 / 100
PASS

Pass: 7 · Warnings: 0 · Errors: 0

JSON-001: Valid JSON object PASS
Parsed 11 top-level properties cleanly.
SEC-LEAK-000: No leaked credentials detected PASS
Zero API keys, Bearer secrets, or PEM private keys found in manifest payload.
RFC8414-ISS-001: Valid HTTPS issuer PASS
issuer: https://auth.example.com
RFC8414-authorization_endpoint: authorization_endpoint verified PASS
https://auth.example.com/oauth/authorize
RFC8414-token_endpoint: token_endpoint verified PASS
https://auth.example.com/oauth/token
RFC8414-PKCE-001: PKCE S256 supported PASS
Required by OAuth 2.1 and MCP Authorization spec.
RFC8414-REG-001: Dynamic client registration / CIMD advertised PASS
Supports autonomous MCP client onboarding.
HTTP Header & Caching Deployment Checklist
  • Serve with `Content-Type: application/json; charset=utf-8` (never `text/plain` or SPA HTML fallback).
  • Include `Access-Control-Allow-Origin: *` so browser-based agent inspectors and web clients can fetch discovery JSON.
  • Use `Cache-Control: public, max-age=300` instead of `immutable` so skill/scope updates propagate quickly.
Live Well-Known Audit 98.4% Lack Agent Cards

Verify live A2A, MCP, OAuth & AEO discovery in production

In RungLab's N=140 B2B SaaS Readiness Benchmark, 98.4% (62/63) of full-telemetry domains lacked agent-card.json. Audit your live domain with ReadyCheck, cut MCP schema token tax with MCPDiet, or automate fleet discovery checks via Apify & RapidAPI.

Required Endpoints, Paths & MIME Types

Path / Endpoint Purpose Required Content-Type
/.well-known/oauth-authorization-server RFC 8414 OAuth 2.0 Authorization Server Metadata document application/json; charset=utf-8
/.well-known/openid-configuration OIDC Discovery fallback checked by MCP clients when RFC 8414 returns 404 application/json; charset=utf-8

RFC 8414 /.well-known/oauth-authorization-server (MCP OAuth 2.1)

oauth-authorization-server.json
{
  "issuer": "https://auth.example.com",
  "authorization_endpoint": "https://auth.example.com/oauth/authorize",
  "token_endpoint": "https://auth.example.com/oauth/token",
  "jwks_uri": "https://auth.example.com/.well-known/jwks.json",
  "registration_endpoint": "https://auth.example.com/oauth/register",
  "scopes_supported": ["mcp:read", "mcp:tools", "agent:invoke", "offline_access"],
  "response_types_supported": ["code"],
  "grant_types_supported": ["authorization_code", "refresh_token"],
  "code_challenge_methods_supported": ["S256"],
  "token_endpoint_auth_methods_supported": ["none", "client_secret_post"],
  "client_id_metadata_document_supported": true
}

Verify Issuer Exact-Match & PKCE S256 Support

verify-rfc8414.sh
curl -fsSL "https://auth.example.com/.well-known/oauth-authorization-server" | jq '{
  issuer,
  authorization_endpoint,
  token_endpoint,
  pkce: .code_challenge_methods_supported,
  dcr: .registration_endpoint,
  cimd: .client_id_metadata_document_supported
}'

Key Empirical & Architectural Takeaways

  • In RungLab's 100-server MCP audit, 39 of 40 auth-gated endpoints (97.5%) advertised RFC 8414 metadata paired with RFC 9728 resource discovery.
  • OAuth 2.1 and MCP Authorization mandate PKCE with S256 — omitting code_challenge_methods_supported: ["S256"] breaks security-hardened agent hosts.
  • Advertising either registration_endpoint (RFC 7591 Dynamic Client Registration) or client_id_metadata_document_supported: true (CIMD) lets unconfigured IDE/agent clients onboard cleanly.

Common Production Pitfalls to Avoid

  • Trailing-slash mismatch between authorization_servers[0] in RFC 9728 (e.g. https://auth.example.com) and issuer inside RFC 8414 (e.g. https://auth.example.com/) fails strict RFC 8414 §3.3 issuer validation.
  • Advertising legacy implicit flow response_types_supported: ["token"] or plain PKCE method instead of ["code"] + ["S256"].
  • Forgetting path-insertion rules when your issuer contains a path (e.g. https://auth.example.com/tenant1 resolves to /.well-known/oauth-authorization-server/tenant1 per RFC 8414 §3).

More Agent Discovery Specifications & Framework Guides

Backend Framework Route Handlers + Middleware

Next.js App Router /.well-known/* Route Handlers & Headers

Serve /.well-known/agent-card.json, /.well-known/mcp/server.json, and /.well-known/oauth-protected-resource cleanly in Next.js App Router without middleware auth redirects or trailing-slash loops.

← Back to AI Agent Discovery Generator & Validator Hub

Frequently Asked Questions

How do RFC 9728 and RFC 8414 work together?

RFC 9728 sits on your MCP/API resource domain (/.well-known/oauth-protected-resource) and points to your Auth Server issuer URL; the client then fetches RFC 8414 (/.well-known/oauth-authorization-server) from that issuer to obtain /authorize, /token, and PKCE rules.

Can I use our existing Auth0, Clerk, Stytch, or WorkOS tenant as the RFC 8414 server?

Yes, provided the provider publishes valid RFC 8414 or OIDC discovery JSON, supports PKCE S256, and allows either Dynamic Client Registration (RFC 7591) or Client ID Metadata Documents.

Why does our validator flag missing S256 in RFC 8414 manifests?

Without explicit code_challenge_methods_supported: ["S256"], OAuth 2.1 and MCP clients refuse authorization code flows to prevent authorization code interception attacks.