HTTP Digest Auth Parameters

HTTP Digest Authentication header parameters — realm, qop, nonce, nc, ha1.

Reference for HTTP Digest Authentication WWW-Authenticate and Authorization header parameters with the MD5/SHA-256 response algorithm and a live response digest computer.

How is the Digest response computed?

With qop=auth the response is H(HA1:nonce:nc:cnonce:qop:HA2), where HA1 = H(username:realm:password) and HA2 = H(method:digestURI). H is the hash named by the algorithm parameter (MD5 by default, or SHA-256). Without qop the simpler legacy form H(HA1:nonce:HA2) is used.

HTTP Digest Authentication

Digest auth is an HTTP challenge-response scheme that proves knowledge of a password without sending it in cleartext, by hashing it together with a server nonce. This reference lists every parameter in the WWW-Authenticate challenge and the Authorization response, plus the exact hashing algorithm — and a live computer that reproduces the response value.

How it works

The server replies 401 with a challenge; the client answers with a hashed response. With qop=auth the algorithm (RFC 7616) is:

HA1 = H(username ":" realm ":" password)
HA2 = H(method ":" digestURI)
response = H(HA1 ":" nonce ":" nc ":" cnonce ":" qop ":" HA2)

H is the function named by algorithmMD5 by default or SHA-256. The legacy form (no qop) is response = H(HA1 ":" nonce ":" HA2). With qop=auth-int, HA2 = H(method ":" digestURI ":" H(entityBody)) so the body is covered too. The client returns username, realm, nonce, uri, qop, nc, cnonce, response and echoes opaque.

Tips and notes

  • nc is an 8-digit hex counter that must increase for each request reusing the same nonce; the server rejects repeats to block replay.
  • A stale=true flag means the nonce expired but the credentials were fine — the client retries with a fresh nonce, no password prompt needed.
  • MD5 Digest is cryptographically weak; use SHA-256 where supported and always run Digest over TLS.
  • The browser-side computer below uses Web Crypto for SHA-256; MD5 is computed with a small built-in implementation since Web Crypto does not provide it.