What is Basic Authentication in REST APIs?

Answer

Basic Authentication is the simplest HTTP authentication scheme. The client encodes the username and password as Base64(username:password) and sends it in the Authorization header: Authorization: Basic dXNlcjpwYXNzd29yZA==. It is simple to implement and supported natively by all HTTP clients. However, it has significant drawbacks: credentials are sent with every request (only safe over HTTPS), Base64 is not encryption (trivially reversible), and there is no built-in token expiry or revocation. Basic Auth is acceptable for internal or simple APIs, but for public APIs or user-facing applications, prefer API keys, OAuth 2.0, or JWT-based authentication. Always enforce HTTPS when using Basic Auth.