HTTP Authorization Headers Explained: Basic, Bearer, Digest, AWS SigV4
How the main HTTP authentication schemes work, how to build each Authorization header correctly and how to debug signature mismatch errors step by step.

HTTP Authorization Headers Explained
Almost every API call carries an Authorization header, and almost every integration hits a 401 or a "signature does not match" error at some point. The cause is usually a small detail: the wrong encoding, a missing newline, parameters sorted differently, or a clock a few minutes off. The free HTTP Authorization Header Builder builds the header for five schemes and shows every intermediate string, so you can see exactly where your code differs. This guide explains the schemes.
Basic authentication
Basic (RFC 7617) joins the username and password with a colon, encodes the result as UTF-8 and then Base64:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
That is Aladdin:open sesame. Base64 is an encoding, not encryption: anyone who sees the header can decode it, so Basic must only be used over HTTPS. The username cannot contain a colon, because the colon separates the two parts.
Bearer tokens
Bearer (RFC 6750) carries a token obtained elsewhere, usually an OAuth 2.0 access token or an API key:
Authorization: Bearer eyJhbGciOi…
Whoever holds the token can use it, so treat tokens like passwords: HTTPS only, never in URLs or logs, and short lifetimes.
Digest authentication
Digest (RFC 7616) avoids sending the password. The server sends a realm and a one-time nonce. The client computes HA1 as MD5 of username:realm:password, HA2 as MD5 of method:uri, and the response as MD5 of HA1, the nonce, a counter, its own client nonce, the quality of protection and HA2. The builder's implementation reproduces the worked example in RFC 2617. Digest with MD5 is considered weak today; it survives in older devices such as cameras and routers.
HMAC-signed requests
Many payment, webhook and internal APIs sign requests with a shared secret. A typical scheme builds a canonical string from the method, path, sorted query string, a timestamp and a hash of the body, then computes HMAC-SHA256 with the secret. The signature proves you know the secret and that nothing was changed in transit, and the timestamp stops old requests being replayed. Every provider has its own exact recipe, so compare the canonical string the builder shows with your provider's documentation.
AWS Signature Version 4
AWS and many S3-compatible services use SigV4. It has four steps:
- Build the canonical request: method, URI path, sorted and encoded query, lower-case sorted headers with their values, the list of signed headers and the SHA-256 of the body.
- Build the string to sign: the algorithm name, the timestamp, the credential scope (date, region, service, aws4_request) and the SHA-256 of the canonical request.
- Derive the signing key with a chain of HMACs: the secret, then the date, region, service and aws4_request.
- Compute the signature as HMAC-SHA256 of the string to sign with that key.
The builder's implementation matches the official AWS test vectors.
Debugging a mismatch
When a server rejects your signature:
- Compare your canonical request character by character with the one shown here, or with the one AWS includes in its error response.
- Check that header names are lower-case and sorted, and values trimmed.
- Check query parameters are sorted and encoded with the right rules (spaces as %20, not +).
- Make sure the region and service names are right.
- Check your clock: SigV4 rejects requests more than about five minutes off.
Safe experimenting
Secrets are typed into password fields, used only in your browser and never saved with your settings. Use test keys when you can, and rotate any key you suspect has been exposed. The builder also gives a curl command so you can reproduce the request from a terminal.



