Design signup, login, password reset, and session or token issuance. Hash passwords with a slow KDF, throttle credential stuffing, support email verification, and optional OAuth social login. Expose clean APIs for SPA and mobile clients.
Functional requirements
- Register with email/password; verify email via token link
- Login issues session or JWT refresh pair based on product choice
- Password reset via time-limited signed token
- Optional OAuth2 code flow with Google/GitHub
Non-functional requirements
- Resistance to brute force and credential stuffing (rate limits, CAPTCHA)
- Secrets never logged; passwords never stored plaintext
- Availability of login independent of non-critical profile services