Security and failure cases
The ways OAuth deployments fail, such as redirect URI mistakes, code interception and token theft, and the defenses for each.
Start with Redirect URI validation
- Redirect URI validationFollow an attacker who bends a redirect URI to collect authorization codes, see how careless matching fails, and learn what the server and client each check.
- Request correlation and CSRFSee how a forged callback can link your account to an attacker's photos, which session-bound checks stop it, and how SameSite cookies affect the return trip.
- Code interception and injectionFollow a stolen authorization code through interception and injection, see why client authentication cannot stop injection while PKCE can, and handle a reused code.
- Authorization server mix-upWalk through a mix-up attack in which a compromised authorization server tricks a client into handing over another server's code, and compare the defenses.
- Token theft and replayTrace where access tokens leak, what a replayed bearer token allows and for how long, and how lifetimes, audiences, and sender-constrained tokens limit the damage.
- Refresh token theftSee why refresh tokens attract thieves, how client authentication and rotation block or reveal their use, where rotation leaves a gap, and how to contain a theft.
- OAuth security best practicesReview the OAuth 2.0 Security Best Current Practice role by role, learn the few protections not covered elsewhere, and see how OAuth 2.1 consolidates them.