Skip to content

Instantly share code, notes, and snippets.

@BijanProgrammer
Last active October 24, 2025 12:28
Show Gist options
  • Select an option

  • Save BijanProgrammer/e106a63b7afd30d7d897654144008973 to your computer and use it in GitHub Desktop.

Select an option

Save BijanProgrammer/e106a63b7afd30d7d897654144008973 to your computer and use it in GitHub Desktop.
The Ultimate Authentication Guide

The Ultimate Authentication Guide

  • Authentication vs Authorization
  • Types of Authentication
    • Single-factor Authentication (SFA)
    • Two-factor Authentication (2FA)
      • Security Questions
      • One-time Password (OTP)
      • Time-based One-time Password (TOTP)
    • Multi-factor Authentication (MFA)
      • Something The User Knows (Password or Secret Questions)
      • Something The User Has (Phone or Email)
      • Something The User Is (Fingerprints or Face ID Scans)
    • Password-less Authentication
    • Single Sign-on (SSO)
  • RESTful & HTTP
    • Server & Client
    • Request & Response
    • Stateless vs Stateful
    • Requesting index.html
    • Requesting Other Resources Like CSS, JS, Images, Fonts and ...
    • Fetch & API
    • HTTP Methods
    • HTTP Status Codes
  • Sign Up
    • Password Hashing
    • Salting
  • Storing User Data
    • Cookie
    • Session
    • LocalStorage
    • Remember Me
  • Cookies
    • Setting Cookies from Client with document.cookie
    • Setting Cookies from Server with Set-Cookie
    • Set-Cookie Header vs Cookie Header
    • Securing Cookies with Attributes
      • Secure Attribute & Man-in-the-middle Attack
      • HttpOnly Attribute & Cross-site Scripting (XSS) Attack
      • SameSite Attribute & Cross-site Request Forgery (CSRF) Attack
      • Domain Attribute
      • Path Attribute
  • Sign In
    • Generating Token
    • JWT
    • Setting Token with Set-Cookie
    • Sending Cookies Back to Server with Each Request
  • Sign Out
    • Clearing Cookies from Server
  • Security Concerns
    • Fully Check Token Validity and Not Just Availability
    • Route Guards
    • Lazy Load Guarded Routes
    • CAPTCHA
    • reCAPTCHA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment