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.
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.
| Control / Header | Hardened Baseline | Security & Compliance Rationale |
|---|---|---|
Subdomain Isolation |
auth-mail.<domain> (Never mix w/ marketing) |
Prevents marketing ESP reputation issues or lookalike campaigns from affecting login emails |
DMARC Policy |
v=DMARC1; p=reject; adkim=s; aspf=s |
Strictly rejects forged login/OTP emails pretending to originate from your domain |
Token Entropy & TTL |
>=256-bit CSPRNG · <=10 min · Single-Use |
Store only SHA-256 token hash in DB and invalidate immediately on first POST consume |
Cross-Browser Defense |
__Host-magic_bind Cookie / Same-Session Check |
Prevents email scanners or forwarded links from signing in an attacker's browser |
; Dedicated Auth Subdomain (auth-mail.acme.example.com) auth-mail.acme.example.com. 300 IN TXT "v=spf1 include:amazonses.com -all" _dmarc.auth-mail.acme.example.com. 300 IN TXT "v=DMARC1; p=reject; sp=reject; adkim=s; aspf=s; pct=100; rua=mailto:[email protected]"
<!-- Never consume a magic-link token on HTTP GET (corporate email scanners prefetch GET links!) --> <form method="POST" action="/auth/magic-link/verify"> <input type="hidden" name="token_id" value="OPAQUE_SINGLE_USE_ID" /> <button type="submit">Complete Sign-In to Acme</button> </form>
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.
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.
← Back to AuthPosture Hub · AuthPosture ($39 Fix Pack) → · hub.runglab.dev → · dev.runglab/devtools →
Enterprise gateways (Microsoft Safe Links, Proofpoint, Mimecast) prefetch URLs via HTTP GET. Fix it by rendering a confirmation page on GET and consuming the token only on POST.
Subdomain isolation gives login emails clean DKIM/SPF alignment, protects root domain SPF lookup budgets, and enforces DMARC p=reject cleanly.
Yes — audit live on https://auth.runglab.dev ($39 AuthPosture Fix Pack) or https://audit.runglab.dev.