# What is WWW-Authenticate?

> WWW-Authenticate is the response header a Hypertext Transfer Protocol (HTTP) server uses to challenge a client that asked for a protected resource. It names the authentication schemes the server accepts and the parameters each one needs.

Explainer by Boston Identity, 2026-11-29. 7 min read. https://insights.bostonidentity.com/glossary/www-authenticate

- What it is: standard
- Defined by: IETF, RFC 9110 (STD 97)
- Who it's for: Teams running APIs and the clients or agents that call them

## What is WWW-Authenticate?

Suppose an AI agent your team built calls an application programming interface (API) it has never used before, and the API turns it away. One line in that refusal tells the agent what to try next: which kind of credential to present and, under one newer specification, where to find the server that issues tokens [BI-FIND-2025-0388](https://insights.bostonidentity.com/ref/BI-FIND-2025-0388). The server that writes that line is one the agent has no reason to trust yet. The authors of Request for Comments (RFC) 9728 name the risk. A malicious resource server can use the line to get a client to request a token with a legitimate server's scope, then replay that token at the legitimate server [BI-FIND-2025-0391](https://insights.bostonidentity.com/ref/BI-FIND-2025-0391).

The line is the WWW-Authenticate header field. RFC 9110, the Internet Engineering Task Force (IETF) standard for HTTP semantics, defines it as the response header that indicates the authentication schemes and parameters applicable to the resource the client asked for [S1 §11.6.1]. HTTP gives servers a general challenge-and-response framework: a server challenges a client's request, and the client provides authentication information [S1 §11.1]. A server that generates a 401 (Unauthorized) response must send WWW-Authenticate with at least one challenge [S1 §11.6.1].

RFC 9110 defines the framework and stops there. It specifies no authentication schemes; those are specified independently and ought to be registered in the HTTP Authentication Scheme Registry [S1 §11.1]. So the header that carries the "basic" scheme in one deployment [S1 §11.1] carries a Bearer challenge with an error code in another [BI-FIND-2012-0003](https://insights.bostonidentity.com/ref/BI-FIND-2012-0003).

Think of it like this: A sign on a venue door: members show a card, guests show a ticket from the box office round the corner. The comparison stops at the sign's author: here whoever answers the door writes the sign, and a dishonest door can send you to fetch something it means to misuse.

Not the same as: Not the same as the Authorization header, which travels the other way: the client sends it with a request to present its credentials [S1 §11.6.2]. And it is not tied to the 401 alone. A server may send it in other responses to indicate that supplying credentials, or different credentials, might affect the response [S1 §11.6.1].

## How does WWW-Authenticate work?

Two parties take part: a user agent, the client program making the request, and an origin server, the server that holds the protected resource. A proxy that forwards the response must not modify the header [S1 §11.6.1].

[Figure: The origin server sets the terms in its 401; the user agent picks a scheme, answers with Authorization, and the server either challenges again, refuses with 403, or lets the request through.]

1. **The user agent asks for a protected resource.** A user agent sends a request for a protected resource. The request omits credentials, contains invalid ones (a bad password, for example), or contains partial ones, as when the authentication scheme needs more than one round trip [S1 §11.4].
2. **The origin server answers with a challenge.** The origin server should send a 401 (Unauthorized) response that contains a WWW-Authenticate header field. The field holds at least one challenge that applies to the requested resource, and the challenge can be a new one [S1 §11.4]. Any server that generates a 401 must send the header [S1 §11.6.1].
3. **The challenge names a scheme and its parameters.** Each challenge begins with a case-insensitive token that identifies the authentication scheme [S1 §11.1]. What the scheme needs comes next: a comma-separated list of name and value parameters, or a single sequence of characters that can hold base64-encoded information [S1 §11.2]. One reserved parameter, realm, lets a scheme indicate a scope of protection [S1 §11.5]. The field can contain more than one challenge, and the header can occur more than once [S1 §11.6.1].
4. **The user agent picks a challenge.** The user agent ought to select the challenge with what it considers the most secure scheme it understands, and obtain credentials from the user as appropriate [S1 §11.4].
5. **The user agent sends credentials.** The user agent authenticates itself by including an Authorization header field with the request. It usually does this after receiving a 401, but not necessarily [S1 §11.3]. The value consists of the user agent's credentials for the realm of the resource being requested [S1 §11.6.2].
6. **The origin server judges the credentials.** If the credentials are invalid or partial, the origin server should answer with a 401 and a challenge again. If they are valid but not adequate to gain access, the server ought to respond with 403 (Forbidden) [S1 §11.4]. Once a request has been authorized, the user agent may reuse the same credentials for other requests in the same protection space. That space is the server's origin combined with the realm value, if present, and the reuse lasts for a period set by the scheme, its parameters or user preferences [S1 §11.5].

## Why does WWW-Authenticate matter now?

In October 2026 we read two Internet-Drafts that take opposite positions on this header. Three authors from Tempo Labs and two from Stripe propose to make HTTP 402 work as an ordinary authentication exchange. The server answers with WWW-Authenticate: Payment, and the client pays and retries with Authorization: Payment and a credential [BI-FIND-2026-0527](https://insights.bostonidentity.com/ref/BI-FIND-2026-0527). Revision -08 of an IETF draft for signed requests goes the other way. Any failed authentication of a signed request must get a 400 (Bad Request). A 401 stays not recommended, because it would bring in WWW-Authenticate and Authorization headers the profile cannot use [BI-FIND-2026-1395](https://insights.bostonidentity.com/ref/BI-FIND-2026-1395).

The Model Context Protocol (MCP) authorization specification of June 2025 says a server must publish Protected Resource Metadata naming at least one authorization server, and must use the WWW-Authenticate header to point to it when it returns 401. That applies only when authorization is used, which is optional [BI-FIND-2025-0562](https://insights.bostonidentity.com/ref/BI-FIND-2025-0562). RFC 9728 supplies the pointer: a resource_metadata parameter in the header that points to a metadata document, from which the client reads the authorization server [BI-FIND-2025-0388](https://insights.bostonidentity.com/ref/BI-FIND-2025-0388).

Open Authorization (OAuth) documents put more into the same line. RFC 6750 has the resource server answer a failed bearer-token request with a Bearer challenge and one of three error codes [BI-FIND-2012-0003](https://insights.bostonidentity.com/ref/BI-FIND-2012-0003). RFC 9470 adds an error value, insufficient_user_authentication, for an API that turns down a request because the sign-in behind the access token was not strong enough or recent enough [BI-FIND-2023-0051](https://insights.bostonidentity.com/ref/BI-FIND-2023-0051).

## Where does it fit?

- Compared with OAuth 2.0 Protected Resource Metadata: The metadata is a document an API publishes; WWW-Authenticate is one way a client finds it. RFC 9728 lets a resource server answer an unauthenticated call with a WWW-Authenticate header whose resource_metadata parameter points to that document [BI-FIND-2025-0388](https://insights.bostonidentity.com/ref/BI-FIND-2025-0388).
- Compared with RFC 6750 (OAuth 2.0 Bearer Token Usage): RFC 6750 uses the header for one scheme, Bearer: when a request with a bearer token fails, the resource server answers with a WWW-Authenticate challenge using that scheme and one of three error codes [BI-FIND-2012-0003](https://insights.bostonidentity.com/ref/BI-FIND-2012-0003). RFC 9110 defines the header and specifies no schemes [S1 §11.1].
- Compared with OAuth 2.0 Step Up Authentication Challenge: Step-up is one use of the challenge. Under RFC 9470 the API's WWW-Authenticate challenge carries the error value insufficient_user_authentication, and can list the authentication context class references it accepts and the number of seconds allowed since the user last actively signed in [BI-FIND-2023-0051](https://insights.bostonidentity.com/ref/BI-FIND-2023-0051).

## What goes wrong?

- Parsing. A field value can contain more than one challenge, each with a comma-separated list of parameters, and the header can occur several times. Some user agents do not recognize more than one challenge on the same field line, so sending them that way might not be interoperable [S1 §11.6.1]. Many clients also fail to parse a challenge that contains an unknown scheme; the workaround RFC 9110 gives is to list well-supported schemes such as "basic" first [S1 §11.3].
- Credentials travel in headers. RFC 9110 says this implies significant security considerations for the confidentiality of the underlying connection [S1 §11.4].
- Reuse has a boundary the client may not see. The extent of a protection space is not necessarily known to clients without additional information, and unless the scheme specifically allows it, a single protection space cannot extend outside the scope of its server [S1 §11.5].
- The challenge comes from the server being called. A malicious resource server can use a WWW-Authenticate challenge to get a client to request a token with a legitimate server's scope, then replay that token at the legitimate server. The RFC 9728 authors recommend audience-restricted tokens and Resource Indicators (RFC 8707) [BI-FIND-2025-0391](https://insights.bostonidentity.com/ref/BI-FIND-2025-0391).
- The pointer needs checking. When a metadata address came from a WWW-Authenticate challenge, the resource value in the document must be identical to the address the client called, and if they differ the data must not be used. Our briefing on three MCP authorization bugs found one MCP software development kit that never made this comparison [BI-FIND-2025-0389](https://insights.bostonidentity.com/ref/BI-FIND-2025-0389). We read the check as proof that the document belongs to the address the client called. It says nothing about whether that resource is honest.

## What should a security leader ask?

1. Which of our clients and AI agents follow a pointer in a WWW-Authenticate challenge to fetch metadata or request a token, and what do they check before using what comes back?
2. When one of our clients reads resource metadata it found through a challenge, does it compare the document's resource value with the address it called and discard the data on a mismatch?
3. Are the tokens our clients request restricted to one audience, the service the token is for, so a token requested at one server's prompting cannot be replayed at another?
4. When our APIs return a 401, which schemes do they list and in what order, and have we tested the clients that fail on an unknown scheme?

## Sources

- [S1] [RFC 9110: HTTP Semantics](https://www.rfc-editor.org/rfc/rfc9110) (IETF, Internet Standard (STD 97), June 2022)

## Evidence

- [BI-FIND-2025-0388](https://insights.bostonidentity.com/ref/BI-FIND-2025-0388): RFC 9728 lets a client that knows nothing about an API find out where to get a token for it. The resource server may answer an unauthenticated call with a WWW-Authenticate header whose resource_metadata parameter points to a JSON metadata document; the client reads the authorization server from it and then fetches that server's own RFC 8414 metadata. A later challenge tells the client the metadata may have changed, which the authors say lets a resource server change authorization servers "without any other coordination with clients." Only the resource field is required, authorization_servers is optional, and how the client gets a client identifier is out of scope. The RFC never mentions AI agents. Our briefing on the Model Context Protocol's 2026-07-28 authorization specification found that it requires MCP servers to publish this document. (from "RFC 9728 tells clients where an API's tokens come from and leaves most of the trust decision to them")
- [BI-FIND-2025-0391](https://insights.bostonidentity.com/ref/BI-FIND-2025-0391): Two of the risks the authors name come from a client following pointers a resource hands it. A malicious resource server can use a WWW-Authenticate challenge to get a client to request a token with a legitimate server's scope, then replay that token at the legitimate server. The authors say the attack is possible in plain OAuth but "made somewhat more likely by the use of dynamically configured clients," so they recommend audience-restricted tokens and Resource Indicators (RFC 8707), and say a client that talks to several resource servers SHOULD request them. Because the client fetches an issuer it learned from the resource, clients SHOULD also guard against server-side request forgery, for example by blocking internal IP address ranges. (from "RFC 9728 tells clients where an API's tokens come from and leaves most of the trust decision to them")
- [BI-FIND-2012-0003](https://insights.bostonidentity.com/ref/BI-FIND-2012-0003): When a request with a bearer token fails, RFC 6750 has the resource server answer with a WWW-Authenticate challenge using the Bearer scheme and one of three error codes. invalid_request SHOULD come with HTTP 400, invalid_token (expired, revoked, malformed or otherwise invalid) with 401, and insufficient_scope with 403. For insufficient_scope the server MAY name the scope the resource needs, so a client can learn what its token lacked. Scope values are left to each authorization server; the RFC says they are "implementation defined" and that there is no central registry. Later RFCs we have read add to this same challenge: RFC 9470 adds an error value for a sign-in that is too old or too weak, and RFC 9728 adds a pointer to the API's metadata. (from "RFC 6750 tokens work for whoever holds them; RFC 9700 now urges key binding and bars them from query strings")
- [BI-FIND-2026-0527](https://insights.bostonidentity.com/ref/BI-FIND-2026-0527): Three authors from Tempo Labs and two from Stripe propose to make HTTP 402 work as an ordinary authentication exchange. The server answers with WWW-Authenticate: Payment, carrying a challenge id, a method, an intent and a request object; the client pays and retries with Authorization: Payment and a credential; the server "verifies and settles" and only then returns the resource, normally with a receipt. Servers must bind the challenge id to its parameters and reject a credential that echoes anything else, and a payment proof "MUST be usable exactly once". The draft defines no payment rail. Methods and intents go in new registries, so the procedures for verifying and settling a payment with any particular method are left to separate specifications. (from "Stripe and Tempo propose paying for an HTTP request the way you log in to one, and leave the agent out")
- [BI-FIND-2026-1395](https://insights.bostonidentity.com/ref/BI-FIND-2026-1395): Revision -08 makes the failure path normative and deliberately uninformative. Any failed authentication of a signed request, whether the identity token fails validation or the signature does not verify, must now get a 400 (Bad Request), where -07 only suggested that code, and the server 'MUST NOT distinguish in the response which check failed'. A 401 stays not recommended, because it would bring in WWW-Authenticate and Authorization headers the profile cannot use. A problem-details body is a SHOULD, with three new problem types for IANA to register. We read this as one opaque error at the edge: telling a stale token from a broken signature has to come from the server's own logs. (from "The IETF's stronger workload proof is built for the proxy in the middle, and it still leaves replay protection optional")
- [BI-FIND-2025-0562](https://insights.bostonidentity.com/ref/BI-FIND-2025-0562): The revision maps MCP onto plain OAuth roles. The MCP server is an OAuth 2.1 resource server, the MCP client an OAuth 2.1 client acting "on behalf of a resource owner", and the authorization server's workings are "beyond the scope of this specification". Discovery is mandatory: a server MUST publish Protected Resource Metadata (RFC 9728) naming at least one authorization server and MUST use the WWW-Authenticate header to point to it when it returns 401; the authorization server MUST publish RFC 8414 metadata; and where several are listed, the client chooses. All of it applies only when authorization is used, which is OPTIONAL: HTTP transports SHOULD conform, and STDIO implementations SHOULD NOT and take credentials from the environment instead. The page never uses the word delegation, and where it says "agent" it means the user's browser. (from "MCP's June 2025 authorization spec: a server accepts only tokens issued for it and passes none upstream")
- [BI-FIND-2023-0051](https://insights.bostonidentity.com/ref/BI-FIND-2023-0051): RFC 9470 gives an API a standard way to turn down a request because the user's sign-in behind its access token was not strong enough or recent enough, and to say what would pass. The API answers with a WWW-Authenticate challenge carrying a new error value, insufficient_user_authentication. In acr_values it can list the authentication context class references it accepts, in order of preference, and in max_age the number of seconds allowed since the user last actively signed in. The client SHOULD carry them, when present, into its authorization request as the OpenID Connect parameters of the same names. How the API decides that a request needs more is out of scope, and the RFC calls "step up" a metaphor that does not suggest "an absolute hierarchy of authentication methods expressed in interoperable fashion." (from "RFC 9470 lets an API demand a fresher or stronger sign-in, with no shared scale for 'stronger'")
- [BI-FIND-2025-0389](https://insights.bostonidentity.com/ref/BI-FIND-2025-0389): The RFC's defence against a forged metadata document is a comparison the client makes. The resource value in the document MUST be identical to the identifier the client used to build the metadata URL or, when the URL came from a WWW-Authenticate challenge, to the URL the client called. If they differ, "the data contained in the response MUST NOT be used." The authors say this blocks an attacker who publishes a document carrying another resource's identifier with values of its own choosing, and they make TLS certificate checking on the metadata request a MUST as well. We read the check as proof that the document belongs to the URL the client called, which says nothing about whether that resource is honest. Our briefing on three MCP authorization bugs found one MCP SDK that never made this comparison. (from "RFC 9728 tells clients where an API's tokens come from and leaves most of the trust decision to them")

---

© 2026 Boston Identity LLC. All rights reserved. Published by Boston Identity LLC.
Quote up to 100 words with the credit "Boston Identity, IAM Insights" and a link to https://insights.bostonidentity.com/glossary/www-authenticate as the source. Claim numbers may be cited freely. Training, fine-tuning and evaluation use of this page is permitted, and the text-and-data-mining reservation is lifted on it. Republishing it or offering it as a data set still needs permission.
Terms: https://insights.bostonidentity.com/terms · How to cite: https://insights.bostonidentity.com/cite
