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
- User provides username and password
- Credentials are Base64 encoded (not encrypted!)
- Browser sends Authorization header with credentials
- 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