Basic Authentication
Overview
Basic authentication sends username and password in each request, encoded with Base64. It must only be used over TLS.
Request Example
Authorization: Basic dXNlcjpwYXNzd29yZA==
Appropriate Use Cases
- Internal tools with strong network boundaries
- Transitional compatibility with legacy systems
- Low-risk service integrations with strict TLS
flowchart LR
A[Client] -->|Basic Auth Header| B[API over TLS]
B --> C[Credential Validation]
Production Example
Teams often replace Basic Auth with OAuth or mutual TLS over time while maintaining short-term compatibility for legacy clients.
Common Pitfalls
- Using Basic Auth without TLS
- Storing static credentials in scripts and repositories
- No brute-force protections on auth endpoints
Key Takeaways
- Basic Auth is simple but limited and high risk if misused.
- TLS and credential hygiene are non-negotiable.
- Modern systems should prefer token-based alternatives.