Track 07 of 10Identity and login
- 01Authentication vs authorization
- 02Browser storage compared
- 03Sessions versus tokens
- 04Inside a JWT
- 05Access and refresh tokens
- 06Where to keep tokens
- 07Choosing a design
- 08The login lifecycle
- 09The token clock
- 10Dead or just unlucky? Refresh decisions
- 11Inside a secure session cookie
- 12Five tabs, one refresh
- 13“Log in with Google”: OAuth and PKCE
- 14Two-factor login
- 15Storing passwords
- 16Logging out properly
- 17Trade-offs and common mistakes
- 18Compare the designs
Track 07 of 10
Identity and login
How an app knows who you are, keeps you signed in safely, and what each design gives up.
18 lessons · about 125 minutes
- Authentication vs authorizationWho are you, and what may you do? Toggle the server's checks and find the leaks.6 min
- Browser storage comparedSave one value in five places, then reload, open tabs and run an XSS script.7 min
- Sessions versus tokensA looked-up session or a signed token: log in, then try to kick yourself out.7 min
- Inside a JWTMake yourself an admin and watch a real signature give you away.7 min
- Access and refresh tokensShort-lived access, long-lived refresh, and the rotation that catches a thief.7 min
- Where to keep tokensEvery storage choice trades XSS for CSRF. See where each secret lives in five setups.8 min
- Choosing a designAnswer six questions and see the five common auth setups ranked for your project.6 min
- The login lifecycleStep through login, reloads, expiry, outages and logout across three zones.10 min
- The token clockRefresh early, recover once: drag time across a token and skew the clock.6 min
- Dead or just unlucky? Refresh decisionsOnly a dead session logs you out. Pick what the auth server answers.6 min
- Inside a secure session cookieSeal a cookie with real AES-GCM, tamper with it, then switch its flags off.8 min
- Five tabs, one refreshWake five tabs at once and collapse fifteen refreshes into one.6 min
- “Log in with Google”: OAuth and PKCELog in with Google step by step, then let an extension steal the code.8 min
- Two-factor loginBind the code step to the password step, and count the guesses a code allows.8 min
- Storing passwordsHash three users' passwords for real, then read the leaked table like an attacker.7 min
- Logging out properlyThree ways to log out, and what each leaves behind for the next person.6 min
- Trade-offs and common mistakesThe costs and pitfalls that show up again and again, and what fixes each one.6 min
- Compare the designsEvery design side by side, plus the ways people prove who they are.6 min