Join our Newsletter — 33% off our NHI Course
Home› Guides› HTTP Authentication Schemes Reference: Basic, Bearer, Digest, Negotiate…
Guide Web & API Security

HTTP Authentication Schemes Reference: Basic, Bearer, Digest, Negotiate and DPoP in WWW-Authenticate

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 13 min read
On this page

Every API and web service that returns 401 is choosing an authentication scheme, and the scheme decides whether a stolen header is a minor event or a full account and token compromise. HTTP defines one challenge and response framework, carried in the WWW-Authenticate and Authorization header fields, and many schemes plug into it. This reference covers the five schemes practitioners meet most often: Basic, Digest, Bearer, DPoP and Negotiate (Kerberos and NTLM). For each it gives the defining specification, what the credential is, whether it resists replay, how much it depends on TLS, and how to harden it. It is written for API, platform and identity developers who build or review services and the machine clients that call them.

Key takeaways

  • The framework is shared, the security is not. RFC 9110 Section 11 defines challenges, credentials and realms; the scheme name in the challenge decides everything else about strength.
  • Basic and Bearer are only as safe as TLS. Both send a reusable secret in every request, so anyone who sees the header can replay it until the password changes or the token expires.
  • DPoP binds a token to a key. RFC 9449 requires a fresh signed proof per request, tied to the method, URI and token hash, so a leaked access token alone is not enough.
  • Negotiate should mean Kerberos. Microsoft deprecated all NTLM versions in June 2024 and removed NTLMv1 from Windows 11 24H2 and Windows Server 2025; plan HTTP services so that Negotiate never needs to fall back.
  • Error responses are part of the design. Use 401 with a challenge for missing or bad credentials, 403 for valid but insufficient credentials, and never put secrets in URLs.

How HTTP authentication challenges work

RFC 9110 (HTTP Semantics) Section 11 sets out the generic framework that every scheme uses.

  1. Challenge: a server that needs credentials responds with 401 Unauthorized. RFC 9110 says a server generating a 401 MUST send a WWW-Authenticate field with at least one challenge. A proxy uses 407 Proxy Authentication Required and Proxy-Authenticate.
  2. Credentials: the client retries with Authorization (or Proxy-Authorization) carrying the scheme name and its credentials.
  3. Result: the server either accepts, returns 401 again, or returns 403 Forbidden when the credentials are valid but not adequate for the resource.
  4. Optional follow-up: Authentication-Info can carry scheme-specific data back, such as a next nonce in Digest.

Syntax rules worth knowing: the scheme name is case-insensitive. Parameters are name and value pairs, each parameter name may appear only once per challenge, and some schemes use a single token68 blob instead (Basic credentials and Negotiate tokens look like this). A response may carry several challenges, which lets a server offer, for example, both DPoP and Bearer.

Realm and protection space: the realm parameter names a protection space. RFC 9110 defines the protection space as the origin plus the realm, so a client may reuse credentials within it. Pick distinct realms for areas with different trust levels.

Proxies: a proxy must not modify WWW-Authenticate or Authentication-Info when forwarding; the proxy-specific fields apply only to the next hop. Make sure gateways and API management layers do not strip or rewrite challenges.

The IANA HTTP Authentication Scheme Registry lists every registered scheme. Besides the five in this guide it includes Concealed (RFC 9729), GNAP (RFC 9635), HOBA (RFC 7486), Mutual (RFC 8120), OAuth (the OAuth 1.0 scheme, RFC 5849), PrivateToken (RFC 9577), SCRAM-SHA-1 and SCRAM-SHA-256 (RFC 7804) and vapid (RFC 8292).

Scheme reference table

SchemeDefining specificationCredential sentReplay resistanceTLS dependence
BasicRFC 7617 (Standards Track, 2015)Base64 of user-id:passwordNone: the same value works every timeTotal: the password is effectively cleartext
DigestRFC 7616 (Standards Track, 2015)Hash response over nonce, cnonce, nonce count, method and URIPartial: nonces and nonce counts limit replayHigh: no confidentiality, downgrade and dictionary attacks possible
BearerRFC 6750 (Standards Track, 2012)OAuth access tokenNone: any holder can use it until expiryTotal: RFC 6750 requires TLS
DPoPRFC 9449 (Standards Track, 2023)Key-bound access token plus a signed proof JWT in the DPoP headerStrong: proof bound to method, URI, time, token hash, optional server nonceStill required: RFC 9449 says DPoP must always be used with HTTPS
NegotiateRFC 4559 (Informational, 2006)Base64 SPNEGO token (Kerberos or NTLM)Kerberos: authenticator and ticket lifetime limit replay; NTLM: exposed to relayHigh: protects neither headers nor body, TLS recommended

The challenge parameters differ by scheme:

SchemeCommon challenge parametersNotes
Basicrealm, charset="UTF-8"charset is advisory; password is NFC normalised and UTF-8 encoded when used
Digestrealm, nonce, opaque, qop, algorithm, stale, userhash, domainqop is required; stale=true tells the client to retry with a new nonce
Bearerrealm, scope, error, error_description, error_uriErrors: invalid_request (400), invalid_token (401), insufficient_scope (403)
DPoPalgs, plus Bearer-style error valuesErrors include invalid_dpop_proof and use_dpop_nonce; nonce sent in DPoP-Nonce
NegotiateNone at first; later a token68 blobMulti-round exchange; IANA notes it is connection-oriented, contrary to HTTP semantics

Basic and Digest

Basic (RFC 7617): the client joins user-id and password with a colon and Base64-encodes the result, so a user-id cannot contain a colon. The RFC states that Basic is not considered a secure method of user authentication on its own: credentials travel in what is effectively cleartext, users reuse passwords across sites, and clients can be tricked by counterfeit servers. A client may reuse credentials for URIs under the same path prefix but must not reuse http credentials for https.

Basic still appears in three places: legacy APIs with static credentials, internal tooling behind a reverse proxy, and token endpoints that use Basic to carry an OAuth client ID and secret. In each case the secret is a long-lived non-human credential. Use TLS everywhere, store server-side passwords with a proper password hash, rotate the credential on a schedule, and prefer replacing it with OAuth client credentials, private key JWT or mTLS. See the mTLS Guide. Microsoft's retirement of Basic authentication for Exchange Online SMTP AUTH shows the direction of travel; see Exchange Online SMTP AUTH Basic Auth Retirement.

Digest (RFC 7616): RFC 7616 obsoleted RFC 2617, made SHA-256 mandatory to implement, kept SHA-512/256 as a backup and marked MD5 as NOT RECOMMENDED, retained only for backward compatibility. The server sends a nonce; the client answers with a hash over the nonce, its own cnonce, a nonce count (nc), the method and the URI. The server can rotate nonces with nextnonce in Authentication-Info and prove itself with rspauth.

The RFC's own security considerations are blunt: with human-memorable passwords Digest is open to dictionary attacks, it provides no confidentiality, qop=auth-int gives only limited integrity, a man-in-the-middle can inject weaker schemes to force a downgrade, and the server stores H(A1), which is password-equivalent and must be protected like plaintext passwords. Treat Digest as a compatibility scheme for devices and appliances, always over HTTPS, never as the design for a new API.

Bearer and DPoP

Bearer (RFC 6750): any party in possession of the token can use it. The preferred and mandatory-to-support transport is the Authorization: Bearer header. A form-encoded body is allowed only in narrow cases, and the URI query parameter is discouraged because URLs are logged; clients must not use more than one method in a single request. RFC 6750's security recommendations are TLS with certificate validation, short-lived tokens (one hour or less), no tokens in cookies that can be sent in cleartext, tokens restricted to the intended resource server and scopes, and no tokens in page URLs.

On errors, a request with no credentials should get a challenge with no error code. An expired or revoked token gets 401 with error="invalid_token"; a valid token without the right privileges gets 403 with error="insufficient_scope" and optionally the required scope. Keep error_description developer-facing and free of internal detail.

DPoP (RFC 9449): DPoP sender-constrains access and refresh tokens at the application layer. The client keeps a private key and sends Authorization: DPoP <token> plus a DPoP header containing a JWT with typ dpop+jwt, an asymmetric alg, its public jwk, and the claims below.

ClaimMeaningResource server check
jtiUnique proof identifierReject reused values within the acceptance window
htmHTTP methodMust match the request method
htuTarget URI without query or fragmentMust match the request URI
iatCreation timeWithin a short window
athBase64url SHA-256 hash of the access tokenMust match the presented token
nonceServer-supplied nonce, when requiredMust equal the current DPoP-Nonce

The authorisation server records the binding in the token's cnf claim as a jkt (JWK SHA-256 thumbprint), and the resource server checks that the proof key matches. A resource server must reject a DPoP-bound token presented under the Bearer scheme, which blocks downgrade. Nonces: a server can demand a fresh nonce through the DPoP-Nonce header; resource servers signal this with 401 and error="use_dpop_nonce", authorisation servers with 400. Nonces limit how long pre-generated proofs stay usable, and the RFC says authorisation server and resource server nonces should be kept separate.

Limits: DPoP does not protect bodies or most headers, and malicious code running in the client, for example through XSS, can still mint valid proofs while the client is online. Use non-extractable keys where the platform allows and keep standard XSS defences. See the DPoP Guide for deployment detail.

Negotiate (Kerberos and NTLM)

RFC 4559 is an Informational document describing Microsoft's SPNEGO-based scheme. The server answers with a bare WWW-Authenticate: Negotiate; the client returns a Base64 SPNEGO token in Authorization: Negotiate, and the exchange may take several rounds. With Kerberos the service principal is HTTP/hostname. Authentication is tied to the connection, so a proxy must never share an authenticated connection between clients, and the mechanism authenticates the user to the server only: it protects neither the headers nor the message body. TLS is recommended, and RFC 4559 notes that TLS certificate hashes can serve as channel bindings.

NTLM retirement direction: Microsoft's deprecated features list states that all versions of NTLM, including LANMAN, NTLMv1 and NTLMv2, are no longer under active feature development and are deprecated (announced June 2024), and that NTLMv1 is removed starting in Windows 11 version 24H2 and Windows Server 2025 (update dated November 2024). NTLM as a whole continues to work for now, with no full removal date published as of November 2026. Microsoft's guidance is to call Negotiate, which tries Kerberos and falls back to NTLM only when necessary. Timelines move, so check the current Microsoft page before planning.

Making Negotiate use Kerberos: register correct SPNs for each HTTP host name, avoid connecting by IP address or unregistered aliases (which forces fallback), enable Extended Protection for Authentication (channel binding) on IIS and similar servers, and audit NTLM use before blocking it. See the Kerberos vs NTLM, NTLM Deprecation and Elimination Guide and NTLM Relay Guide.

Choosing and hardening a scheme

SituationRecommended schemeWhy
Public or partner API, OAuth already in placeBearer with short-lived, audience-restricted tokens; DPoP for high-value APIsStandard tooling; DPoP removes the stolen-token replay risk
Single-page app or mobile client holding tokensDPoP with non-extractable keysTokens exfiltrated from storage cannot be replayed without the key
Service-to-service inside one organisationBearer from workload identity, or mTLS-bound tokensNo static secrets; binding at the transport layer
Intranet web app on Active DirectoryNegotiate, configured for Kerberos onlySingle sign-on with no NTLM fallback
Legacy device or applianceDigest with SHA-256 over HTTPS, otherwise Basic over HTTPS behind an authenticating proxyCompatibility; contain and plan replacement

Small versus large estates: a small team with a handful of APIs should standardise on one OAuth issuer, Bearer tokens of an hour or less and a gateway that enforces audience and scope, adding DPoP for the most sensitive endpoints. Large estates with many clients and machine identities gain more from DPoP or mTLS binding across the board, because token theft from logs, CI systems and developer machines is the common failure at scale. See the mTLS vs Signed Tokens for Service Authentication comparison and the API Security Guide.

Hardening steps that apply to every scheme:

  1. Inventory: list which schemes each endpoint accepts, from gateway configuration and from WWW-Authenticate headers observed in 401 responses.
  2. Remove weak options first: disable Basic and Digest with MD5 where a stronger scheme exists; a server offering several challenges invites downgrade.
  3. Enforce TLS and HSTS: no scheme in this guide is safe over plain HTTP.
  4. Keep credentials out of logs: mask Authorization, Proxy-Authorization and DPoP headers in proxies, APM tools and error reports, and reject tokens in query strings.
  5. Pilot and roll back safely: introduce DPoP or Kerberos-only in report or monitor mode, measure clients still using the old scheme, then enforce per client, keeping the previous configuration ready to restore.

Detection, measurement and framework mapping

  • Scheme mix: share of authenticated requests by scheme per API; the target is zero Basic and zero MD5 Digest on internet-facing endpoints.
  • NTLM fallback rate: NTLM authentications on HTTP services (Windows NTLM auditing, event 8001 to 8004 in the NTLM Operational log), trending to zero.
  • Token replay signals: DPoP proofs rejected for reused jti, mismatched ath, or Bearer use of a bound token.
  • 401 and 403 spikes: bursts of invalid_token or failed Basic logins from one source, a sign of password spraying (ATT&CK T1110.003) or stolen tokens (T1550.001).
  • Secrets in URLs: count of requests with tokens in query strings found in access logs (should be zero).
FrameworkReferenceRelevance
NIST SP 800-53 Rev 5IA-2, IA-5Authenticating users and managing passwords, tokens and keys
NIST SP 800-53 Rev 5SC-8, SC-23TLS protection and session authenticity for credential-bearing requests
MITRE ATT&CK v20T1550.001 Application Access Token; T1557 Adversary-in-the-Middle; T1110.003 Password SprayingToken replay, relay and credential guessing against HTTP endpoints
OWASP API Security Top 10 2023API2:2023 Broken AuthenticationScheme choice and token handling are core to this risk

Practitioner checklist

  • Return 401 with a WWW-Authenticate challenge for missing or invalid credentials and 403 for insufficient privileges.
  • Remove Basic and MD5 Digest from internet-facing endpoints; where Basic must stay, enforce TLS, hashed storage and rotation.
  • Issue Bearer tokens of one hour or less, restricted by audience and scope, sent only in the Authorization header.
  • Adopt DPoP for high-value APIs and public clients, validate every proof claim and use server nonces.
  • Reject DPoP-bound tokens presented as Bearer.
  • Configure Negotiate for Kerberos with correct SPNs and channel binding, audit NTLM, and block it once usage reaches zero.
  • Mask authentication headers in every log and telemetry pipeline.
  • Track scheme mix, NTLM fallback and token replay rejections as standing metrics.

Standards and references

Related NHI Mgmt Group resources: API Security Guide · DPoP Guide · mTLS Guide · Kerberos vs NTLM · NTLM Deprecation and Elimination Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.