Why it matters
Validate state and prefer PKCE when the platform supports it.
Practical steps
- Threat-model sec oauth state: spoofed webhooks, leaked tokens, and confused-deputy admin actions.
- Implement validate state and prefer PKCE when the platform supports it with constant-time compares where secrets are involved.
- Never log raw tokens, signing secrets, or full payment payloads.
- Add unit tests that prove forgeries fail closed for sec oauth state.
- Document rotation and incident steps for sec oauth state in the security runbook.
Watch out for
- Copy-pasting outdated snippets for sec oauth state without re-reading current official docs.
- Shipping sec oauth state to production without a staging rehearsal and a documented rollback.