skip to content

How is a bearer token transmitted on an HTTP request per RFC 6750, and what does the word 'bearer' actually mean about how the server treats it?

level: juniorimportance: must knowfreq 70%

answer

  1. Authorization: Bearer <token>
  2. scheme case-insensitive, token case-sensitive
  3. b64token charset: A-Za-z0-9-._~+/ and trailing =
  4. possession = authorization, no proof of holder
  5. header only; query param discouraged; TLS + no-store

basics

~20 s

Send Authorization: Bearer <token> on each request, over TLS. 'Bearer' means possession alone proves authorization: the request carries no proof of who is holding it, so whoever copies the token can use it exactly like the legitimate client.

solid answer

~50 s

The carriage is one header: `Authorization: Bearer eyJhbGciOi...`. The scheme name is case-insensitive, one space separates it from the token, and the token itself is an opaque string the client must not interpret — it may be a JWT, a random database key, or anything else; carriage does not care. "Bearer" is the security statement. Like a bearer bond or a cinema ticket, the server honours the token on presentation alone — there is no signature over the request, no client key, no binding to a device or connection. A stolen value replays perfectly from anywhere. That is why RFC 6750 requires TLS, requires responses to authenticated requests to be marked `Cache-Control: no-store`, and pushes hard against putting tokens in URLs. RFC 6750 also defines a form-body parameter and a URI query parameter, but the header is the method every server must support and the only one you should use.

code

http · 7 lines
http
GET /v1/orders/42 HTTP/1.1
Host: api.example.com
Authorization: Bearer mF_9.B5f-4.1JqM

HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store

go deeper

for a junior

State the exact header form, that it goes on every request over TLS, and that possession alone is what the server checks.

for a middle

Add the token-is-opaque rule, the allowed token charset, the no-store requirement and why the query-parameter method is discouraged.

for a senior

Contrast bearer with proof-of-possession carriage, cover audience restriction and short lifetimes, and cover client hygiene like never attaching a default Authorization header to foreign origins.

for a principal

Discuss where bearer semantics are acceptable given who can observe headers in your topology, and when sender-constrained carriage or token exchange between services becomes worth the operational cost.

## The wire format RFC 6750 defines the `Bearer` authentication scheme within the HTTP authentication framework. A request carries: ``` Authorization: Bearer mF_9.B5f-4.1JqM ``` Details that come up in interviews: - **The scheme name is case-insensitive** (`Bearer`, `bearer`, `BEARER` are all valid to parse), but conventionally written `Bearer`. The **token value is case-sensitive**. - Exactly one space separates scheme and token, and the token is a `b64token`: characters `A–Z a–z 0–9 - . _ ~ + /` with optional trailing `=`. That charset is why base64url-encoded JWTs fit without escaping. - The token is **opaque to the client**. Even when it happens to be a JWT the client can decode, RFC 6750 treats it as a bare string to relay; only the issuer and the resource server are entitled to interpret it. - **One credential per request.** Sending a token in two places at once (say header and query parameter) is a malformed request, and the server should reject it rather than pick a winner. ## What "bearer" means A bearer credential is honoured on the basis of possession alone. Compare it to the alternatives: - A **Basic** credential is also possession-based, but the secret is a long-lived password the user knows. - A **proof-of-possession** credential (mutual TLS per RFC 8705, or DPoP per RFC 9449) requires the client to demonstrate control of a private key on each request, so a copied token is useless without the key. - A **bearer** token requires nothing beyond presenting the string. So the entire security of the scheme rests on the token never being seen by anyone else, and on it not being valuable for long. There is no request signature, no channel binding, no client identity check — a proxy, a log file or an attacker who obtains the string is, from the server's point of view, the client. ## What the server does with it Validation is out of scope for the carriage spec, but the two shapes are worth knowing. If the token is self-contained (typically a signed JWT), the resource server verifies the signature and checks claims such as expiry, issuer and audience locally — fast, but revocation before expiry needs extra machinery. If the token is a random opaque handle, the server looks it up, usually by calling the issuer's introspection endpoint or reading shared state — slower per request, but revocation is immediate. Either way the client's behaviour is identical, which is the point of an opaque credential. ## The other two carriage methods RFC 6750 defines three ways to send a bearer token: the `Authorization` header, a `access_token` form-encoded body parameter (only for `application/x-www-form-urlencoded` bodies), and an `access_token` URI query parameter. Only the header must be supported by servers. The body method exists for constrained clients that cannot set headers; the URI method exists for cases where neither is possible and is explicitly discouraged, because URLs leak into logs, browser history, `Referer` headers and shared links. Modern practice — and later OAuth security guidance — is header-only. ## Required companions Because possession is everything, RFC 6750 attaches conditions to using it at all: - **TLS is mandatory**, with certificate validation. A bearer token over plaintext is a password over plaintext, except it may also unlock more than one service. - **Responses to authenticated requests should carry `Cache-Control: no-store`**, so shared caches do not retain private data or, worse, a token echoed in a body. - **Tokens should be short-lived and audience-restricted**, so a leak is bounded in time and in which service accepts it. - **Never log the `Authorization` header**, and scrub it in tracing, error reporting and HAR captures. ## Common client mistakes - Writing `Authorization: <token>` with no scheme, or `Authorization: Bearer: <token>` with a stray colon — both are malformed and produce confusing 401s. - Sending `Bearer undefined` or `Bearer null` when the token store is empty, instead of omitting the header, which turns a clean anonymous request into an invalid-token error. - Attaching the token to requests for third-party origins because the HTTP client was configured with a global default header. Bearer tokens must be scoped to the audience that issued them. - Sending both a session cookie and a bearer token and assuming the server prefers one; it may honour the other, which has real CSRF implications. ## The sentence to say in an interview "A bearer token is carried in the `Authorization: Bearer <token>` header, is opaque to the client, and is honoured purely on possession — so it is only as safe as TLS, short lifetimes, narrow audience and disciplined logging make it."

  • Is the Bearer scheme name case-sensitive? What about the token value?
    The scheme name is case-insensitive, so a server must accept `bearer` as readily as `Bearer`; conventionally clients send `Bearer`. The token value itself is case-sensitive and must be relayed byte-for-byte, which matters because base64url encodings differ only by case in places.
  • Does the resource server need to know how the token was created?
    Not for carriage — the header format is identical whether the token is a signed JWT or a random opaque handle. It matters for validation: a self-contained token is verified locally by signature and claims, while an opaque handle must be looked up or introspected. The client is unaffected either way and must treat the token as an opaque string.

A bearer token is a cinema ticket: the usher checks the ticket, not you. Anyone who picks it up off the floor gets the same seat.

saying these in an interview costs you the question

  • Omitting the `Bearer` scheme name, or writing `Authorization: Bearer: <token>` with a colon
  • Believing the token being a JWT means it is encrypted or that the client may parse and trust it
  • Sending `Bearer undefined`/`Bearer null` instead of omitting the header when no token is held
  • Thinking possession is verified against the client somehow — that a stolen token would not work elsewhere
  • Putting the token in a query parameter because 'the RFC allows it'

context