Authentication, identity & authorization
Passwords, MFA and passkeys, where browsers keep credentials, token rotation, OAuth with PKCE and OIDC, authorization models and tenant isolation.
6 lessons
Credentials and sessions
- 1Storing credentials, slow password hashing, MFA and passkeysA salt makes the attacker guess one account at a time; only a slow, memory-hard hash makes each guess expensive.
- 2Browser credential storage boundariesSeparate page lifetime, origin storage, and browser-attached session state before choosing a sign-out or credential-storage design.
- 3Access and refresh tokens: rotation and reuse detectionEvery refresh hands out a new refresh token; a used one coming back ends the whole sign-in.
Delegated identity
Authorization and tenancy
- 5Authorization models and enforcementA role can start the question; the protected object, relationship and context finish it.
- 6Multi-tenancy isolation and Postgres row-level securityRow security puts the tenant filter inside the database, for every role except the table's owner, superusers and bypassers.