Use OAuth Authorization Code with PKCE in a browser app
8 steps · about 3 h 17 min · Intermediate
- Begin with the current OAuth security model (reference, IETF Datatracker, 35 min)
Use the security best current practice to discard obsolete implicit and weak redirect patterns.
- Bind the code with PKCE (reference, IETF Datatracker, 30 min)
Generate a verifier and challenge so an intercepted authorization code cannot be redeemed by another client.
- Trace the authorization-code exchange (reference, IETF Datatracker, 28 min)
Map browser redirect, authorization response and token exchange before implementing callbacks.
- Discover server metadata safely (reference, IETF Datatracker, 18 min)
Use declared endpoints and capabilities instead of hard-coding assumptions about the authorization server.
- Validate identity token claims (reference, OpenID Foundation, 28 min)
Check issuer, audience, signature and timing claims before treating identity data as authenticated.
- Bind access tokens to a resource (reference, IETF Datatracker, 18 min)
Request the intended protected resource so a token is not ambiguously usable across services.
- Plan explicit token revocation (reference, IETF Datatracker, 16 min)
Make logout and account disconnect revoke credentials rather than only clearing interface state.
- Threat-model the finished flow (guide, OWASP Cheat Sheet Series, 24 min)
Audit redirect validation, state binding, scope, storage and refresh behavior against common implementation mistakes.