About basic auth generator
HTTP Basic authentication sends a username and password in an Authorization header, encoded with Base64. This tool builds the header and example code.
How the header is built
The username and password are joined as username:password, encoded in Base64 and prefixed with the word Basic. Example: Authorization: Basic dXNlcjpwYXNz.
Encoded is not encrypted
Anyone who sees the header can decode it. Use Basic authentication only over HTTPS and prefer tokens for anything public.
A worked example
For the user name user and the password pass, the text user:pass is Base64-encoded to dXNlcjpwYXNz, and the header is Authorization: Basic dXNlcjpwYXNz. The cURL form is curl -u user:pass https://api.example.com.
Safer habits
- Use it only over HTTPS, because the header can be decoded by anyone who sees it.
- Prefer API tokens that you can revoke over real account passwords.
- Never commit a header to source control.
