OAuth 2.1 PKCE S256 Checklist: Exact Redirects, S256 & Token Security
Validate Authorization Code + PKCE S256 enforcement, exact redirect_uri string matching, sender-constrained refresh tokens, and deprecated OAuth 2.0 flow removal.
Generate compliant RFC 9728 /.well-known/oauth-protected-resource manifests and 401 WWW-Authenticate challenges for remote Streamable HTTP MCP servers and APIs.
{
"resource": "https://mcp.acme.example.com/mcp",
"authorization_servers": [
"https://auth.acme.example.com"
],
"bearer_methods_supported": [
"header"
],
"scopes_supported": [
"openid",
"profile",
"email",
"mcp:tools"
],
"resource_documentation": "https://mcp.acme.example.com/docs/auth",
"dpop_signing_alg_values_supported": [
"ES256",
"EdDSA"
],
"dpop_bound_access_tokens_required": true
}
HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer resource_metadata="https://mcp.acme.example.com/.well-known/oauth-protected-resource", scope="openid profile email mcp:tools" Cache-Control: no-store
Run an automated live authentication probe on AuthPosture (auth.runglab.dev) or integrate fleet checks via RungLab Hub API (hub.runglab.dev) and Official MCP Server dev.runglab/devtools — or ship the $39 AuthPosture Fix Pack (tailored OIDC & PKCE S256 patches, RFC 9728 MCP metadata, /.well-known/passkey-endpoints, __Host- cookie rules, COOP/CSP login headers, magic-link DMARC/SPF, and SOC 2 CC6.1 / NIST 800-63B CI gate). Prefer PayPal invoicing? Email [email protected].
| Control / Header | Hardened Baseline | Security & Compliance Rationale |
|---|---|---|
Discovery Path |
/.well-known/oauth-protected-resource |
Mandatory MCP Authorization spec discovery path (RFC 9728 §3) |
401 Challenge Header |
WWW-Authenticate: Bearer resource_metadata="..." |
Directs unauthenticated MCP clients to exact protected resource metadata URL |
authorization_servers |
["https://auth.<domain>"] |
Array of trusted OAuth 2.1 / RFC 8414 authorization server issuers |
bearer_methods_supported |
["header"] |
Accept tokens only in Authorization: Bearer header — never query strings |
{
"resource": "https://mcp.acme.example.com/mcp",
"authorization_servers": ["https://auth.acme.example.com"],
"bearer_methods_supported": ["header"],
"scopes_supported": ["openid", "profile", "email", "mcp:tools"],
"resource_documentation": "https://mcp.acme.example.com/docs/auth",
"dpop_signing_alg_values_supported": ["ES256", "EdDSA"],
"dpop_bound_access_tokens_required": true
}
HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer resource_metadata="https://mcp.acme.example.com/.well-known/oauth-protected-resource", scope="openid profile email mcp:tools" Cache-Control: no-store
Validate Authorization Code + PKCE S256 enforcement, exact redirect_uri string matching, sender-constrained refresh tokens, and deprecated OAuth 2.0 flow removal.
Lint OpenID Connect discovery JSON for HTTPS issuers, S256-only PKCE, disabled Implicit response_types, asymmetric JWT algs (ES256/RS256), and RFC 7009 revocation.
Generate FIDO Alliance /.well-known/passkey-endpoints JSON and hardened WebAuthn PublicKeyCredential RP policies requiring residentKey and userVerification.
Validate Set-Cookie headers against RFC 6265bis __Host- rules (Secure, Path=/, zero Domain= attribute), HttpOnly XSS defense, SameSite CSRF protection, and bounded Max-Age.
Generate hardened login-route HTTP response headers combining Cross-Origin-Opener-Policy, CSP frame-ancestors 'none', X-Frame-Options: DENY, Referrer-Policy: no-referrer, and Cache-Control: no-store.
Secure passwordless magic-link and OTP email flows with isolated auth-mail subdomains, strict DMARC p=reject (adkim=s, aspf=s), SPF -all, and same-browser PKCE binding.
← Back to AuthPosture Hub · AuthPosture ($39 Fix Pack) → · hub.runglab.dev → · dev.runglab/devtools →
MCP clients need an automated way to discover which OAuth 2.1 authorization server protects a remote Streamable HTTP MCP endpoint when encountering HTTP 401.
No. Passing bearer tokens in URL query parameters leaks credentials into CDN logs, proxies, and browser history. Restrict to ['header'] only.
Yes — scan live at https://auth.runglab.dev ($39 AuthPosture Fix Pack) or query Official MCP Server dev.runglab/devtools.