Course map

Topic 160 / Core

Identity lifecycle: registration, password storage, MFA, account recovery, lockout and brute-force protection, device and session management

Chapter 10.2 · Identity and Access

What and why

Authentication (→ 159) assumed an identity already exists; this topic is everything that happens to that identity from creation to compromise response. Most breaches don't defeat a strong login — they go around it, through a weaker account recovery flow, an un-throttled login endpoint, or a session nobody thought to revoke. The identity lifecycle is the full set of states an account moves through and the control at each one. Builds on: → 159 (authentication and authorization).

Diagram

Lifecycle stage Risk if missing Control
Registration Fake or unverified accounts Email/phone verification before activation
Password storage Mass credential theft from one breach A slow, salted hash (argon2 or bcrypt as the standard example) — never plaintext or a fast general-purpose hash
MFA enrollment Single-factor takeover A second factor (something you have/are), offered and enforceable
Account recovery Recovery becomes the weakest door Recovery at least as strong as login, never a silent MFA bypass
Lockout / brute-force Unlimited password guessing Throttle and lock after repeated failures (→ 96)
Device & session management A stolen session lives forever List active sessions/devices; let the user revoke; notify on new device

How it works

  1. Registration — verify the identifier (email, phone) before the account is fully active; an unverified account is a liability, not a user.
  2. Password storage — hash with a slow, purpose-built algorithm family (argon2, bcrypt); never store or log the plaintext password, and never roll a custom hashing scheme.
  3. MFA — enroll a second factor and plan its recovery: a lost second factor must not permanently lock out a legitimate user, but recovering it must not become an easier path than the login it protects.
  4. Account recovery — treat it as a full authentication event in its own right; a recovery flow weaker than login is the login, from an attacker's perspective.
  5. Lockout and brute-force protection — throttle login attempts and lock an account (or just that IP, to avoid locking out the real user) after repeated failures, reusing rate limiting (→ 96).
  6. Device and session management — let a user see every active session/device, revoke any of them individually, and get notified when a new one appears.

Practical example

(illustrative). A login endpoint locks an account after 5 failed attempts within a 15-minute window and emails the account owner when a login succeeds from a new device. An attacker trying 10,000 password guesses against one account is stopped at attempt 6; a legitimate user who mistypes their password four times is briefly inconvenienced, never locked out by one slip.

When to use it

  • Use when: any product with user accounts — this is the baseline for topic 159 to mean anything in practice.
  • Avoid when: over-strict lockout thresholds turn into a denial-of-service against legitimate users who mistype a password a few times — tune the threshold, don't remove it.
  • Failure scenarios: an account-recovery flow that bypasses MFA entirely (the classic real-world breach pattern); an unthrottled login endpoint allowing unlimited guesses; session fixation, where a session ID issued before login is reused after login without being rotated.
  • Simpler alternative: for a low-risk internal tool, passwordless magic-link login removes password storage and lockout concerns entirely, at the cost of depending on email delivery for every login.

Practice

(Process kind — fill the template on a small real system; 20–30 min, no lab services). For Project 3 (authentication platform), write the lifecycle for one account end to end: registration and verification, password storage approach, MFA enrollment and its recovery path, lockout threshold and window, and what a user sees and can do in a device/session list. Done when every one of the six stages above has a concrete, specific answer — "we'll figure it out later" fails the exercise.

Key takeaway

An account is a lifecycle, not a login form; the weakest stage — usually recovery — is where real attacks land. Done when you can: design all six stages for a real product and name which stage an attacker would target first. Used next in → 161 (SSO extends this identity across organizations); Project 3.

References

None — this topic makes no external claims.

Source directory

Search the guide