Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 3.29 KB

File metadata and controls

51 lines (36 loc) · 3.29 KB

Authentication & Authorization

Everything needed to prove who a user is and control what they can do — built secure-by-default with hashed passwords, hardened sessions, anti-CSRF, MFA, and least-privilege access control. Map-of-Content for the Authentication module of Secure PHP Development.

Learning Objectives

  • Build login, registration, reset, and verification flows that resist enumeration and brute force.
  • Manage sessions and cookies with the correct security attributes.
  • Add MFA/TOTP and token-based auth (JWT, OAuth) correctly.
  • Enforce authorization with RBAC and the principle of least privilege.

Account Lifecycle

Sessions & Cookies

Strong & Delegated Auth

Authorization

Labs & Exercises

  • Lab-Secure-Login-System — hashing, session regeneration, and brute-force throttling.
  • Lab-Password-Reset-Flow — single-use expiring reset tokens done safely.
  • Lab-JWT-Authentication — issue/verify JWTs and defend the alg-confusion attack.
  • Lab-RBAC-Authorization — enforce roles server-side and defeat an IDOR.
  • Module challenge: add TOTP-based MFA to the login lab — enrol a secret, verify a 6-digit code with a ±1 step window, and store single-use hashed recovery codes.

Related