Learn to Auth!

Basic Authentication

Basic authentication transmits credentials as username and password encoded with Base64. While simple to implement, it should always be used over HTTPS as the credentials are easily decoded.

How It Works

  1. User provides username and password
  2. Credentials are Base64 encoded (not encrypted!)
  3. Browser sends Authorization header with credentials
  4. Server decodes and validates credentials

Authorization Header Example

Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

Pros & Cons

  • ✅ Simple to implement
  • ✅ Widely supported
  • ❌ Credentials sent with every request
  • ❌ Not encrypted (only encoded)
  • ❌ No expiration mechanism