Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · Security · Think Like an Attacker · about 20 min to read

Play it as a journeyTutor comes with a plan

OAuth properly: 2.1, PKCE, DPoP and the device flow

Authorization and Identity
Authorization and Identity · Open board

: who may do what, and how an app gets permission to act for a user. OAuth is the part of that picture where the permission travels as a token. This lesson is about what happens when that token is copied.

Before you start. Authorization & Identity gave you the OAuth handshake: the app sends you to the login page, you approve, and the app gets a short-lived code that it trades for an access token. The badge you cannot take back (the session lifecycle) gave you the short access token plus the longer refresh token, and the idea of revoking a token. Authentication gave you the JWT, a readable payload with a signature on it. Cryptography Foundations gave you the hash and the public-key signature, which this lesson uses.

Lesson 8 of 39 in Security

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • August 2025: tokens that worked from anywhere
  • OAuth 2.1: the same handshake with the unsafe options removed
  • PKCE: a secret that only the real app can show
  • DPoP: a token that works only with the key that asked for it
  • The device flow: logging in on a screen with no keyboard
  • Token lifetimes: how long a stolen token can be used
  • Where the facts come from
  • The whole code flow with PKCE
  • PKCE, run
  • Redirect matching, run
  • DPoP, run
  • The device flow, run
  • Common OAuth bugs, as a checklist

Terms it explains: PKCE, code verifier, code challenge, sender-constrained token, DPoP, proof, device flow, device code, user code, Common mistakes, ABAC, access token, ACL, authorization (authZ), complete mediation, confused deputy, ID token, IDOR, OAuth 2.0, OIDC, RBAC, ReBAC, scope.

Related paper

Review Security