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 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.
| Control / Header | Hardened Baseline | Security & Compliance Rationale |
|---|---|---|
CSP frame-ancestors |
'none' |
Eliminates iframe clickjacking and invisible credential overlay attacks |
Cross-Origin-Opener-Policy |
same-origin (or same-origin-allow-popups) |
Isolates login browsing context group from cross-origin window.opener tampering |
Referrer-Policy |
no-referrer |
Prevents OAuth callback ?code=... or magic-link ?token=... from leaking in Referer headers |
Cache-Control |
no-store, no-cache, must-revalidate |
Prevents shared proxies or browser back-forward caches from storing tokens/HTML |
/login Cross-Origin-Opener-Policy: same-origin Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'; frame-ancestors 'none'; base-uri 'self'; form-action 'self' https://auth.acme.example.com X-Frame-Options: DENY X-Content-Type-Options: nosniff Referrer-Policy: no-referrer Cache-Control: no-store, no-cache, must-revalidate Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
location ~ ^/(login|auth|oauth2) {
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Content-Security-Policy "default-src 'self'; frame-ancestors 'none'; form-action 'self' https://auth.acme.example.com; object-src 'none';" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "no-referrer" always;
add_header Cache-Control "no-store" always;
}
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 compliant RFC 9728 /.well-known/oauth-protected-resource manifests and 401 WWW-Authenticate challenges for remote Streamable HTTP MCP servers and APIs.
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.
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 →
Use same-origin for redirect-based OAuth 2.1 / Passkey flows; use same-origin-allow-popups only on pages that open external IdP sign-in popups needing postMessage back to the opener.
If your callback page loads external CSS, fonts, or telemetry before stripping URL params, strict-origin-when-cross-origin still leaks path/origin metadata whereas no-referrer blocks all leaks.
Run a live audit at https://auth.runglab.dev ($39 AuthPosture Fix Pack) or call https://hub.runglab.dev.