RFC 7616
HTTP Digest Access Authentication
Part 1 of 7, more to come ๐
HTTP Digest Access Authentication ๐
- RFC: 7616
- Category: Standards Track
- Date: September 2015
- Authors: R. Shekh-Yusef, Ed. (Avaya), D. Ahrens (Independent), S. Bremer (Netzkonform)
- Obsoletes: RFC 2617
- Updates: nothing listed
- ISSN: 2070-1721
- Series: Internet Engineering Task Force (IETF)
Abstract โจ
okay so HTTP already has this simple challenge-response auth thing where a server can challenge a client's request, and the client can reply with its auth info ๐ซถ this doc defines the HTTP Digest Authentication scheme that plugs into that mechanism. it's giving clean and it's giving organized ๐
Status of This Memo ๐ง
this is an Internet Standards Track document ๐ฅ
it's a product of the Internet Engineering Task Force (IETF) and it represents the consensus of the IETF community. it got public review and was approved for publication by the Internet Engineering Steering Group (IESG). for more info on Internet Standards, check Section 2 of RFC 5741.
for the current status, any errata, and how to give feedback, go to http://www.rfc-editor.org/info/rfc7616.
Copyright Notice ๐
Copyright (c) 2015 IETF Trust and the persons identified as the document authors. All rights reserved.
this document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as in effect on the date of publication. please read these carefully, because they describe your rights and restrictions for this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they are provided without warranty as described in the Simplified BSD License.
this document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. the person(s) controlling the copyright in some of that material may not have granted the IETF Trust the right to allow modifications outside the IETF Standards Process. without an adequate license from those copyright holders, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process. the exceptions are formatting it for publication as an RFC or translating it into languages other than English. ๐ซ
Table of Contents ๐
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4
2. Syntax Convention . . . . . . . . . . . . . . . . . . . . . . 4
2.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2. ABNF . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3. Digest Access Authentication Scheme . . . . . . . . . . . . . 5
3.1. Overall Operation . . . . . . . . . . . . . . . . . . . . 5
3.2. Representation of Digest Values . . . . . . . . . . . . . 5
3.3. The WWW-Authenticate Response Header Field . . . . . . . 5
3.4. The Authorization Header Field . . . . . . . . . . . . . 9
3.4.1. Response . . . . . . . . . . . . . . . . . . . . . . 11
3.4.2. A1 . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.4.3. A2 . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4.4. Username Hashing . . . . . . . . . . . . . . . . . . 12
3.4.5. Parameter Values and Quoted-String . . . . . . . . . 12
3.4.6. Various Considerations . . . . . . . . . . . . . . . 13
3.5. The Authentication-Info and Proxy-Authentication-Info
Header Fields . . . . . . . . . . . . . . . . . . . . . . 14
3.6. Digest Operation . . . . . . . . . . . . . . . . . . . . 15
3.7. Security Protocol Negotiation . . . . . . . . . . . . . . 16
3.8. Proxy-Authenticate and Proxy-Authorization . . . . . . . 17
3.9. Examples . . . . . . . . . . . . . . . . . . . . . . . . 18
3.9.1. Example with SHA-256 and MD5 . . . . . . . . . . . . 18
3.9.2. Example with SHA-512-256, Charset, and Userhash . . . 19
4. Internationalization Considerations . . . . . . . . . . . . . 20
5. Security Considerations . . . . . . . . . . . . . . . . . . . 21
5.1. Limitations . . . . . . . . . . . . . . . . . . . . . . . 21
5.2. Storing Passwords . . . . . . . . . . . . . . . . . . . . 21
5.3. Authentication of Clients Using Digest Authentication . . 22
5.4. Limited-Use Nonce Values . . . . . . . . . . . . . . . . 23
5.5. Replay Attacks . . . . . . . . . . . . . . . . . . . . . 23
5.6. Weakness Created by Multiple Authentication Schemes . . . 24
5.7. Online Dictionary Attacks . . . . . . . . . . . . . . . . 24
5.8. Man-in-the-Middle Attacks . . . . . . . . . . . . . . . . 25
5.9. Chosen Plaintext Attacks . . . . . . . . . . . . . . . . 25
5.10. Precomputed Dictionary Attacks . . . . . . . . . . . . . 26
5.11. Batch Brute-Force Attacks . . . . . . . . . . . . . . . . 26
5.12. Parameter Randomness . . . . . . . . . . . . . . . . . . 26
5.13. Summary . . . . . . . . . . . . . . . . . . . . . . . . . 26
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27
6.1. Hash Algorithms for HTTP Digest Authentication . . . . . 27
6.2. Digest Scheme Registration . . . . . . . . . . . . . . . 28
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.1. Normative References . . . . . . . . . . . . . . . . . . 28
7.2. Informative References . . . . . . . . . . . . . . . . . 30
Appendix A. Changes from RFC 2617 . . . . . . . . . . . . . . . 31
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 31
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32
1. Introduction ๐ฆ
okay so HTTP gives you a simple challenge-response auth mechanism. a server can use it to challenge a client's request, and the client uses it to send its auth info. this document defines the HTTP Digest Authentication scheme that works with that HTTP authentication mechanism. iconic.
this doc extends [RFC2617] and is generally backward compatible with it. see Appendix A for the new capabilities this spec brings in โจ
the nitty-gritty of the challenge-response flow lives in "Hypertext Transfer Protocol (HTTP/1.1): Authentication" [RFC7235].
the combo of this doc, the "Basic" authentication scheme [RFC7617], "HTTP Authentication-Info and Proxy-Authentication-Info Response Header Fields" [RFC7615], and "Hypertext Transfer Protocol (HTTP/1.1): Authentication" [RFC7235] is what obsoletes [RFC2617]. so yeah, RFC 2617 is retired, bestie ๐ซก
1.1. Terminology ๐
the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. these capital words are the official requirement language, so pay attention to them ๐
2. Syntax Convention ๐
2.1. Examples ๐ธ
for clarity and readability, the extended parameters, or the header fields and parameters in the examples, might get broken into multiple lines. any line that's indented in this document is a continuation of the line before it. ๐
2.2. ABNF ๐
this spec uses the Augmented Backus-Naur Form (ABNF) notation of [RFC5234] and the ABNF List Extension of [RFC7230].
3. Digest Access Authentication Scheme โจ
3.1. Overall Operation ๐ง
the Digest scheme is built on a simple challenge-response paradigm. it challenges using a nonce value, and it might indicate that username hashing is supported. a valid response contains an unkeyed digest of the username, the password, the given nonce value, the HTTP method, and the requested URI. so the password is never sent in the clear, and the username can be hashed depending on what the server indicated. the username and password must be prearranged in some way that this document doesn't cover. main character energy ๐
3.2. Representation of Digest Values ๐ฅ
an optional header field lets the server say which algorithm was used to make the unkeyed digest or digest. this document adds the SHA-256 and SHA-512/256 algorithms. to keep backwards compatibility with [RFC2617], the MD5 algorithm is still supported, but it is NOT RECOMMENDED ๐
the size of the digest depends on the algorithm. the bits in the digest get converted from most significant to least significant bit, four bits at a time, into ASCII. each group of four bits is written in hex using the characters 0123456789abcdef. so binary 0000 is the character '0', 0001 is '1', and so on, all the way up to 1111 being 'f' ๐
if the MD5 algorithm is used, the MD5 digest is 32 hexadecimal characters long. SHA-256 and SHA-512/256 are each 64 hexadecimal characters long. slay the math โจ
3.3. The WWW-Authenticate Response Header Field โจ
okay so ๐ฅน when a server gets a request for something that's behind a lock ๐ and there's no acceptable Authorization header field, it hits back with a 401 Unauthorized status code plus a WWW-Authenticate header field using the Digest scheme, just like the framework above says. ๐
This header can carry these parameters:
realm ๐ A string that gets shown to users so they know which username and password to use. It should contain at least the name of the host doing the authentication, and it might also say which group of users can get in. For example: "registered_users@example.com". (See Section 2.2 of [RFC7235] for more details.) ๐
domain ๐ธ A quoted, space-separated list of URIs, as specified in [RFC3986], that defines the protection space. If a URI is a path-absolute, it's relative to the canonical root URL. (See Section 2.2 of [RFC7235].) An absolute-URI in this list can point to a different server than the web-origin [RFC6454]. The client can use this list to figure out which URIs the same auth info can be sent to: any URI that has a URI in this list as a prefix (after both have been made absolute) MAY be assumed to be in the same protection space. If this parameter is left out or its value is empty, the client SHOULD assume the protection space is every URI on the web-origin. ๐ฆ
This parameter isn't meaningful in Proxy-Authenticate header fields, since the protection space there is always the entire proxy. If it shows up anyway, it MUST be ignored. ๐
nonce ๐ง A server-specified string that should be uniquely generated each time a 401 response is made. It's advised that this string be Base64 or hexadecimal data. Since the string gets passed in the header field lines as a quoted string, the double-quote character isn't allowed unless it's suitably escaped. ๐
The contents of the nonce are implementation dependent, and the quality of the implementation depends on making a good choice. โจ A nonce might, for example, be built as the Base64 encoding of
timestamp H(timestamp ":" ETag ":" secret-data)
where timestamp is a server-generated time, which preferably includes micro- or nanoseconds, or other non-repeating values. ETag is the value of the HTTP ETag header field associated with the requested entity, and secret-data is data known only to the server. ๐ With a nonce of this form, a server would recalculate the hash portion after getting the client's authentication header field, and it would reject the request if the hash didn't match the nonce from that header field or if the timestamp isn't recent enough. That's how the server limits how long the nonce stays valid. โฐ Including the ETag stops a replay request for an updated version of the resource. ๐
Putting the client's IP address in the nonce sounds like it would let the server limit reuse of the nonce to the same client that originally got it. But that breaks, because requests from a single user often go through different proxies. Also, IP address spoofing is not that hard. ๐
An implementation might choose not to accept a previously used nonce or a previously used digest, to protect against a replay attack. Or, an implementation might choose to use one-time nonces or digests for POST or PUT requests and a timestamp for GET requests. For more details on the issues involved, see Section 5 of this document. ๐
The nonce is opaque to the client. ๐ซถ
opaque ๐ A string of data, specified by the server, that SHOULD be returned by the client unchanged in the Authorization header field of later requests with URIs in the same protection space. It is RECOMMENDED that this string be Base64 or hexadecimal data. ๐
stale โญ A case-insensitive flag that says the client's previous request was rejected because the nonce value was stale. If stale is true, the client may wish to simply retry the request with a new encrypted response, without re-prompting the user for a new username and password. The server SHOULD only set stale to true if it receives a request for which the nonce is invalid. If stale is false, or anything other than true, or if the stale parameter isn't present, then the username and/or password are invalid, and new values MUST be obtained. ๐ญ
algorithm ๐ฅ A string that tells you which algorithm was used to produce the digest and an unkeyed digest. If this isn't present, it's assumed to be "MD5". If the algorithm isn't understood, the challenge SHOULD be ignored (and a different one used, if there's more than one). ๐
When it's used with the Digest mechanism, each algorithm has two variants: a Session variant and a non-Session variant. The non-Session variant is written as "<algorithm>", e.g., "SHA-256", and the Session variant is written as "<algorithm>-sess", e.g., "SHA-256-sess". ๐ง
In this document, the string you get by applying the digest algorithm to the data "data" with secret "secret" is written as KD(secret, data). The string you get by applying the unkeyed digest algorithm to the data "data" is written as H(data). KD stands for Keyed Digest, and the notation unq(X) means the value of the quoted-string X without the surrounding quotes and with quoting slashes removed. ๐งฉ
For "<algorithm>" and "<algorithm>-sess":
H(data) = <algorithm>(data)
and
KD(secret, data) = H(concat(secret, ":", data))
For example, for the "SHA-256" and "SHA-256-sess" algorithms:
H(data) = SHA-256(data)
So the digest is the "<algorithm>" of the secret concatenated with a colon concatenated with the data. โจ The "<algorithm>-sess" variant is meant to allow efficient third-party authentication servers. For how it differs in usage, see the description in Section 3.4.2. ๐
qop ๐ This parameter MUST be used by all implementations. It's a quoted string of one or more tokens listing the "quality of protection" values the server supports. The value "auth" means authentication, and the value "auth-int" means authentication with integrity protection. See the descriptions below for calculating the response parameter value for whichever one you pick. Unrecognized options MUST be ignored. ๐ก๏ธ
charset ๐ท This is an OPTIONAL parameter the server uses to say which encoding scheme it supports. The only allowed value is "UTF-8". ๐บ๐น
userhash ๐ซง This is an OPTIONAL parameter the server uses to say it supports username hashing. Valid values are "true" or "false". The default value is "false". ๐
For historical reasons, a sender MUST only generate the quoted string syntax for the following parameters: realm, domain, nonce, opaque, and qop. ๐ฐ๏ธ
For historical reasons, a sender MUST NOT generate the quoted string syntax for the following parameters: stale and algorithm. ๐ โโ๏ธ
3.4. The Authorization Header Field ๐
The client is expected to retry the request, sending an Authorization header field line with the Digest scheme, which is defined according to the framework above. The values of the opaque and algorithm fields must be the ones supplied in the WWW-Authenticate response header field for the entity being requested. ๐
The request can include parameters from the following list:
response ๐ A string of hex digits computed as defined below. It proves that the user knows a password. ๐๏ธ
username ๐โโ๏ธ The user's name in the specified realm. The quoted string contains the name in plaintext or the hash code in hexadecimal notation. If the username has characters that aren't allowed inside the ABNF quoted-string production, the username* parameter can be used. Sending both username and username* in the same header option MUST be treated as an error. ๐ซ
username* ๐บ If the userhash parameter value is set to "false" and the username has characters that aren't allowed inside the ABNF quoted-string production, the user's name can be sent with this parameter, using the extended notation defined in [RFC5987]. ๐จ
realm ๐ See the "realm" definition in Section 3.3. ๐
uri ๐งญ The Effective Request URI (Section 5.5 of [RFC7230]) of the HTTP request. It's duplicated here because proxies are allowed to change the request target ("request-target", Section 3.1.1 of [RFC7230]) in transit. ๐
qop ๐ Shows what "quality of protection" the client applied to the message. Its value MUST be one of the alternatives the server indicated it supports in the WWW-Authenticate header field. These values affect how the response is computed. Note that this is a single token, not a quoted list of alternatives like in WWW-Authenticate. ๐งฉ
cnonce ๐ฆ This parameter MUST be used by all implementations. The cnonce value is an opaque, quoted, ASCII-only string provided by the client. Both the client and server use it to avoid chosen plaintext attacks, to provide mutual authentication, and to provide some message integrity protection. See the descriptions below of how the rspauth and response values are calculated. ๐ซถ
nc ๐ข This parameter MUST be used by all implementations. The nc parameter stands for "nonce count". The nc value is the hexadecimal count of the number of requests (including the current request) that the client has sent with the nonce value in this request. For example, in the first request sent in response to a given nonce value, the client sends nc=00000001. The point of this parameter is to let the server detect request replays by keeping its own copy of this count. If the same nc value shows up twice, then the request is a replay. See the description below of how the response value is constructed. ๐ต๏ธโโ๏ธ
userhash ๐ซง This OPTIONAL parameter is used by the client to say the username has been hashed. Valid values are "true" or "false". The default value is "false". ๐
For historical reasons, a sender MUST only generate the quoted string syntax for the following parameters: username, realm, nonce, uri, response, cnonce, and opaque. ๐ฐ๏ธ
For historical reasons, a sender MUST NOT generate the quoted string syntax for the following parameters: algorithm, qop, and nc. ๐ โโ๏ธ
If a parameter or its value is improper, or required parameters are missing, the proper response is a 4xx error code. ๐จ If the response is invalid, then a login failure SHOULD be logged, since repeated login failures from a single client may indicate an attacker trying to guess passwords. ๐ต๏ธ The server implementation SHOULD be careful with the information it logs, so that it won't put a cleartext password (e.g., one entered into the username field) into the log. ๐
The definition of the response above shows the encoding for its value. The following definitions show how that value gets computed. โจ
3.4.1. Response ๐
okay so if the qop value is "auth" or "auth-int", the response gets built like this ๐ฅ
response = <"> < KD ( H(A1), unq(nonce)
":" nc
":" unq(cnonce)
":" unq(qop)
":" H(A2)
) <">
see below for the definitions of A1 and A2 ๐ซถ
3.4.2. A1 ๐ธ
if the algorithm parameter's value is "<algorithm>", e.g., "SHA-256", then A1 is:
A1 = unq(username) ":" unq(realm) ":" passwd
where
passwd = < user's password >
if the algorithm parameter's value is "<algorithm>-sess", e.g., "SHA-256-sess", then A1 gets calculated using the nonce value from the server's challenge, plus the cnonce value from the client's request, after the client gets a WWW-Authenticate challenge from the server. it uses the server nonce from that challenge (called nonce-prime here) and the client nonce from the response (called cnonce-prime here) to build A1 like this:
A1 = H( unq(username) ":" unq(realm) ":" passwd )
":" unq(nonce-prime) ":" unq(cnonce-prime)
this makes a "session key" for authenticating later requests and responses, and it's different for each "authentication session" โจ, which means way less material gets hashed with any one key. ๐ฆ (note: see further discussion of the authentication session in Section 3.6.) because the server only needs the hash of the user credentials to make the A1 value, this construction could be used with a third-party authentication service so the web server never needs the actual password value ๐. the spec for a protocol like that is beyond the scope of this specification, so we're not going there today ๐
3.4.3. A2 ๐ง
if the qop parameter's value is "auth" or is unspecified, then A2 is:
A2 = Method ":" request-uri
if the qop value is "auth-int", then A2 is:
A2 = Method ":" request-uri ":" H(entity-body)
3.4.4. Username Hashing ๐
to protect the username while it travels from the client to the server, the server SHOULD set the userhash parameter with the value of "true" in the WWW-Authentication header field. ๐ซถ
if the client supports the userhash parameter, and the userhash parameter value in the WWW-Authentication header field is set to "true", then the client MUST calculate a hash of the username after any other hash calculation and include the userhash parameter with the value of "true" in the Authorization header field. if the client doesn't give the username as a hash value, or doesn't include the userhash parameter with the value of "true", the server MAY reject the request ๐
the client does this to hash the username, using the same algorithm it used to hash the credentials:
username = H( unq(username) ":" unq(realm) )
3.4.5. Parameter Values and Quoted-String ๐
heads up, a lot of the parameter values (like the username value) are defined as a "quoted-string". the "unq" notation means the surrounding quotation marks get removed when forming the string A1 โ๏ธ so if the Authorization header field includes the fields
username="Mufasa", realm="myhost@example.com"
and the user Mufasa has the password "Circle Of Life", then H(A1) would be H(Mufasa:myhost@example.com:Circle Of Life) with no quotation marks in the digested string ๐
no white space is allowed in any of the strings that the digest function H() gets applied to, unless that white space is inside the quoted strings or entity body that make up the string being digested. for example, the string A1 from above must be:
Mufasa:myhost@example.com:Circle Of Life
with no white space on either side of the colons, but with the white space between the words in the password value ๐ the other strings digested by H() must not have white space on either side of the colons that separate their fields, unless that white space was in the quoted strings or entity body being digested.
also, if integrity protection is applied (qop=auth-int), the H(entity-body) is the hash of the entity body, not the message body. it's computed before any transfer encoding is applied by the sender, and after it's been removed by the recipient ๐ฅ this includes multipart boundaries and embedded header fields in each part of any multipart content-type. main character energy for the entity body, ngl ๐
3.4.6. Various Considerations ๐ฆ
the "Method" value is the HTTP request method, in US-ASCII letters, as specified in Section 3.1.1 of [RFC7230]. the "request-target" value is the request-target from the request line, as specified in Section 3.1.1 of [RFC7230]. this MAY be "*", an "absolute-URI", or an "absolute-path" as specified in Section 2.7 of [RFC7230], but it MUST agree with the request-target. in particular, it MUST be an "absolute-URI" if the request-target is an "absolute-URI". the cnonce value is a client-chosen value whose purpose is to foil chosen plaintext attacks ๐ก๏ธ
the authenticating server MUST assure that the resource designated by the "uri" parameter is the same as the resource specified in the Request-Line. if they aren't, the server SHOULD return a 400 Bad Request error. (since this may be a symptom of an attack, server implementers may want to consider logging such errors ๐) the whole point of copying info from the request URL into this field is to handle the possibility that an intermediate proxy alters the client's Request-Line. that altered (but presumably semantically equivalent) request would not produce the same digest the client calculated ๐ซ
implementers should be aware of how authenticated transactions need to interact with shared caches (see [RFC7234]) ๐ง
3.5. The Authentication-Info and Proxy-Authentication-Info Header Fields ๐
the Authentication-Info header field and the Proxy-Authentication-Info header field [RFC7615] are generic fields that MAY be used by a server to share some info about the successful authentication of a client response โจ
the Digest Authentication scheme MAY add the Authentication-Info header field in the confirmation request, and include parameters from the following list:
nextnonce
the value of the nextnonce parameter is the nonce the server wants the client to use for a future authentication response. the server MAY send the Authentication-Info header field with a nextnonce field as a way of implementing one-time nonces or otherwise changing nonces. if the nextnonce field is present, the client SHOULD use it when constructing the Authorization header field for its next request. if the client fails to do that, it MAY result in a request to re-authenticate from the server with the "stale=true". ๐ญ server implementations SHOULD carefully consider the performance implications of using this mechanism. pipelined requests won't be possible if every response includes a nextnonce parameter that MUST be used on the next request the server receives. consideration SHOULD be given to the performance vs. security tradeoffs of letting an old nonce value be used for a limited time, so requests can be pipelined. using the nc parameter can keep most of the security advantages of a new server nonce without the deleterious effects on pipelining ๐ธ
qop
indicates the "quality of protection" options the server applied to the response. the value "auth" indicates authentication; the value "auth-int" indicates authentication with integrity protection. the server SHOULD use the same value for the qop parameter in the response that the client sent in the corresponding request ๐
rspauth
the optional response digest in the rspauth parameter supports mutual authentication. the server proves it knows the user's secret, and with qop=auth-int it also provides limited integrity protection of the response ๐ the rspauth value is calculated like the response in the Authorization header field, except that if qop is set to "auth" or isn't specified in the Authorization header field for the request, A2 is:A2 = ":" request-uriand if "qop=auth-int", then A2 is:A2 = ":" request-uri ":" H(entity-body)
cnonce and nc
the cnonce value and nc value MUST be the ones from the client request this message is responding to. the rspauth, cnonce, and nc parameters MUST be present if "qop=auth" or "qop=auth-int" is specified. ๐ซถ
the Authentication-Info header field is allowed in the trailer of an HTTP message sent with chunked transfer coding ๐ง
for historical reasons, a sender MUST only generate the quoted string syntax for the following parameters: nextnonce, rspauth, and cnonce.
for historical reasons, a sender MUST NOT generate the quoted string syntax for the following parameters: qop and nc.
for historical reasons, the nc value MUST be exactly 8 hexadecimal digits. it's giving precise, and I'm obsessed ๐
3.6. Digest Operation ๐
okay so once the Authorization header shows up, the server MAY check its validity by looking up the password for the username that was sent ๐. Then it MUST run the exact same digest operation the client ran (like MD5 or SHA-256 ๐ฅ) and compare the result to the given response value. that's the whole vibe โจ.
ngl this part is so cute: the HTTP server doesn't actually need to know the user's cleartext password ๐. as long as it has H(A1), it can verify an Authorization header field. no cap, that's iconic. ๐
the client's response to a WWW-Authenticate challenge for a protection space starts an authentication session with that protection space ๐ฆ. the session lasts until the client gets another WWW-Authenticate challenge from any server in that protection space. during the session, a client SHOULD remember the username, password, nonce, nonce count, and opaque values, so it can build the Authorization header field for future requests in that protection space ๐ง . the Authorization header field MAY be included preemptively, which improves server efficiency and skips extra round trips for challenges ๐. the server MAY choose to accept the old Authorization info even though the nonce might not be fresh ๐คทโโ๏ธ. or, the server MAY return a 401 response with a new nonce in the WWW-Authenticate header field, which makes the client retry the request. by sending "stale=true" with that response, the server tells the client to retry with the new nonce without prompting for a new username and password ๐ซถ.
because the client is required to send back the opaque parameter the server gave it for the whole session, the opaque data can carry authentication session state ๐. (fyi, anything like that can also be done more easily and safely by putting the state in the nonce, bestie ๐.) for example, a server could be responsible for authenticating content that actually lives on another server ๐. it would do that by having the first 401 response include a domain parameter whose value includes a URI on the second server, plus an opaque parameter holding the state info. the client retries, and the server might respond with "HTTP Redirection" (Section 6.4 of [RFC7231]) pointing at the URI on the second server. the client follows the redirect and passes an Authorization header field that includes the <opaque> data ๐.
proxies MUST be totally transparent in the Digest access authentication scheme ๐ป. that means they MUST forward the WWW-Authenticate, Authentication-Info, and Authorization header fields untouched ๐. if a proxy wants to authenticate a client before forwarding a request to the server, it can do that with the Proxy-Authenticate and Proxy-Authorization header fields from Section 3.8 below ๐ง.
3.7. Security Protocol Negotiation ๐ฆ
it's super useful for a server to know which security schemes a client can handle ๐.
it's possible a server wants to require Digest as its authentication method, even if it doesn't know the client supports it ๐ . a client is encouraged to fail gracefully if the server only specifies authentication schemes it can't handle ๐.
when a server gets a request for a resource, it might challenge the client by responding with a "401 Unauthorized" response that includes one or more WWW-Authenticate header fields ๐. if the server sends multiple challenges, then each one of them MUST use a different digest algorithm ๐. the server MUST add these challenges to the response in order of preference, starting with the most preferred algorithm and followed by the less preferred one โจ.
this specification defines the following algorithms:
SHA2-256(mandatory to implement) ๐SHA2-512/256(as a backup algorithm) ๐ซงMD5(for backward compatibility) ๐ฐ๏ธ
when the client gets the first challenge, it SHOULD use the first challenge it supports, unless a local policy says otherwise ๐.
3.8. Proxy-Authenticate and Proxy-Authorization ๐ธ
the Digest Authentication scheme can also be used to authenticate users to proxies, proxies to proxies, or proxies to origin servers, using the Proxy-Authenticate and Proxy-Authorization header fields ๐ก๏ธ. these header fields are instances of the ones specified in Sections 4.3 and 4.4 of the HTTP/1.1 specification [RFC7235], and their behavior is subject to the restrictions described there ๐. the transactions for proxy authentication are very similar to the ones we already covered ๐.
upon receiving a request that requires authentication, the proxy/server MUST issue the "407 Proxy Authentication Required" response with a "Proxy-Authenticate" header field ๐ฆ. the digest-challenge used in the Proxy-Authenticate header field is the same as the one for the WWW-Authenticate header field defined above in Section 3.3 ๐.
then the client/proxy MUST reissue the request with a Proxy-Authorization header field, with parameters specified just like the Authorization header field in Section 3.4 above ๐ซ.
on subsequent responses, the server sends Proxy-Authentication-Info with parameters that match the ones for the Authentication-Info header field ๐จ.
note that, in principle, a client could be asked to authenticate itself to both a proxy and an end-server, but never in the same response ๐.
3.9. Examples ๐ง
3.9.1. Example with SHA-256 and MD5 ๐
this example assumes an access-protected document is being requested from the server with a GET request ๐ฅ. the URI of the document is http://www.example.org/dir/index.html. both client and server know the username for this document is "Mufasa" and the password is "Circle of Life" (with one space between each of the three words) ๐ฆ.
the first time the client requests the document, no Authorization header field is sent, so the server responds with:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest
realm="http-auth@example.org",
qop="auth, auth-int",
algorithm=SHA-256,
nonce="7ypf/xlj9XXwfDPEoM4URrv/xwf94BcCAzFZH4GiTo0v",
opaque="FQhe/qaU925kfnzjCev0ciny7QMkPqMAFRtzCUYo5tdS"
WWW-Authenticate: Digest
realm="http-auth@example.org",
qop="auth, auth-int",
algorithm=MD5,
nonce="7ypf/xlj9XXwfDPEoM4URrv/xwf94BcCAzFZH4GiTo0v",
opaque="FQhe/qaU925kfnzjCev0ciny7QMkPqMAFRtzCUYo5tdS"
the client can prompt the user for their username and password, and then it responds with a new request that includes the following Authorization header field if the client picks MD5 digest ๐:
Authorization: Digest username="Mufasa",
realm="http-auth@example.org",
uri="/dir/index.html",
algorithm=MD5,
nonce="7ypf/xlj9XXwfDPEoM4URrv/xwf94BcCAzFZH4GiTo0v",
nc=00000001,
cnonce="f2/wE4q74E6zIJEtWaHKaf5wv/H5QzzpXusqGemxURZJ",
qop=auth,
response="8ca523f5e9506fed4657c9700eebdbec",
opaque="FQhe/qaU925kfnzjCev0ciny7QMkPqMAFRtzCUYo5tdS"
if the client chooses SHA-256 to calculate the response, the client responds with a new request including this Authorization header field ๐ :
Authorization: Digest username="Mufasa",
realm="http-auth@example.org",
uri="/dir/index.html",
algorithm=SHA-256,
nonce="7ypf/xlj9XXwfDPEoM4URrv/xwf94BcCAzFZH4GiTo0v",
nc=00000001,
cnonce="f2/wE4q74E6zIJEtWaHKaf5wv/H5QzzpXusqGemxURZJ",
qop=auth,
response="753927fa0e85d155564e2e272a28d1802ca10daf449
6794697cf8db5856cb6c1",
opaque="FQhe/qaU925kfnzjCev0ciny7QMkPqMAFRtzCUYo5tdS"
3.9.2. Example with SHA-512-256, Charset, and Userhash ๐ธ
this example assumes an access-protected document is being requested from the server with a GET request ๐ฅ. the URI for the request is http://api.example.org/doe.json. both client and server know the userhash of the username, support the UTF-8 character encoding scheme, and use the SHA-512-256 algorithm ๐. the username for the request is a variation of "Jason Doe", where the 'a' is actually Unicode code point U+00E4 ("LATIN SMALL LETTER A WITH DIAERESIS"), and the first 'o' is Unicode code point U+00F8 ("LATIN SMALL LETTER O WITH STROKE"). that leads to this octet sequence in the UTF-8 encoding scheme ๐:
J U+00E4 s U+00F8 n D o e
4A C3A4 73 C3B8 6E 20 44 6F 65
the password is "Secret, or not?" ๐คซ.
the first time the client requests the document, no Authorization header field is sent, so the server responds with:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest
realm="api@example.org",
qop="auth",
algorithm=SHA-512-256,
nonce="5TsQWLVdgBdmrQ0XsxbDODV+57QdFR34I9HAbC/RVvkK",
opaque="HRPCssKJSGjCrkzDg8OhwpzCiGPChXYjwrI2QmXDnsOS",
charset=UTF-8,
userhash=true
the client can prompt the user for the required credentials and send a new request with the following Authorization header field ๐ซง:
Authorization: Digest
username="488869477bf257147b804c45308cd62ac4e25eb717
b12b298c79e62dcea254ec",
realm="api@example.org",
uri="/doe.json",
algorithm=SHA-512-256,
nonce="5TsQWLVdgBdmrQ0XsxbDODV+57QdFR34I9HAbC/RVvkK",
nc=00000001,
cnonce="NTg6RKcb9boFIAS3KrFK9BGeh+iDa/sm6jUMp2wds69v",
qop=auth,
response="ae66e67d6b427bd3f120414a82e4acff38e8ecd9101d
6c861229025f607a79dd",
opaque="HRPCssKJSGjCrkzDg8OhwpzCiGPChXYjwrI2QmXDnsOS",
userhash=true
if the client can't provide a hashed username for any reason, it can try a request with this Authorization header field ๐ฅบ:
Authorization: Digest
username*=UTF-8''J%C3%A4s%C3%B8n%20Doe,
realm="api@example.org",
uri="/doe.json",
algorithm=SHA-512-256,
nonce="5TsQWLVdgBdmrQ0XsxbDODV+57QdFR34I9HAbC/RVvkK",
nc=00000001,
cnonce="NTg6RKcb9boFIAS3KrFK9BGeh+iDa/sm6jUMp2wds69v",
qop=auth,
response="ae66e67d6b427bd3f120414a82e4acff38e8ecd9101d
6c861229025f607a79dd",
opaque="HRPCssKJSGjCrkzDg8OhwpzCiGPChXYjwrI2QmXDnsOS",
userhash=false
4. Internationalization Considerations ๐
in challenges, servers SHOULD use the "charset" authentication parameter (case-insensitive) to say which character encoding they expect the user agent to use when generating A1 (see Section 3.4.2) and when doing username hashing (see Section 3.4.4) ๐ฃ๏ธ.
the only allowed value is "UTF-8", matched case-insensitively (see Section 2.3 in [RFC2978]). it tells the user agent that the server expects the username and password to be converted to Unicode Normalization Form C ("NFC", see Section 3 of [RFC5198]) and encoded into octets using the UTF-8 character encoding scheme [RFC3629] ๐ธ.
for the username, recipients MUST support all characters defined in the "UsernameCasePreserved" profile defined in Section 3.3 of [RFC7613], with the exception of the colon (":") character ๐งโ๐คโ๐ง.
for the password, recipients MUST support all characters defined in the "OpaqueString" profile defined in Section 4.2 of [RFC7613] ๐.
if the user agent doesn't support the encoding the server indicated, it can fail the request ๐.
when usernames can't be sent hashed and include non-ASCII characters, clients can include the username* parameter instead, using the value encoding defined in [RFC5987] ๐.
5. Security Considerations ๐
5.1. Limitations โจ
okay bestie, so Digest Authentication with human-memorable passwords is vulnerable to dictionary attacks ๐ญ. Those are way easier than cryptographic attacks on any widely used algorithm, even the ones that are no longer considered secure ๐. So algorithm agility does not make this usage any more secure ๐.
As a result, Digest Authentication SHOULD be used only with passwords that have a reasonable amount of entropy, e.g., 128-bit or more ๐. Passwords like that typically cannot be memorized by humans, but they're perfect for automated web services ๐ค.
If Digest Authentication is being used, it SHOULD be over a secure channel like HTTPS [RFC2818] ๐ซถ.
5.2. Storing Passwords ๐๏ธ
Digest Authentication requires the authenticating agent (usually the server) to store some data derived from the user's name and password in a "password file" associated with a given realm ๐. Normally that might contain pairs of username and H(A1), where H(A1) is the digested value of the username, realm, and password as described above.
Here's the tea โ. If this password file gets compromised, an attacker gets immediate access to documents on the server using that realm ๐ฑ. Unlike, say, a standard UNIX password file, this info doesn't need to be decrypted to access documents in the server realm associated with the file. Decryption, or more likely a brute-force attack, would be needed to get the user's actual password. That's the reason the realm is part of the digested data. If one Digest Authentication password file is compromised, it does not automatically compromise others with the same username and password (though it does expose them to brute-force attack) ๐ .
There are two important security consequences of this. First, the password file must be protected as if it contained unencrypted passwords, because for the purpose of accessing documents in its realm, it effectively does ๐.
Second, the realm string SHOULD be unique among all realms that any single user is likely to use. In particular, a realm string SHOULD include the name of the host doing the authentication ๐ . The inability of the client to authenticate the server is a weakness of Digest Authentication ๐ฅ.
5.3. Authentication of Clients Using Digest Authentication ๐ชช
Digest Authentication does not provide a strong authentication mechanism when compared to public-key-based mechanisms, for example ๐.
Still, it's significantly stronger than, e.g., CRAM-MD5, which has been proposed for use with Lightweight Directory Access Protocol (LDAP) [RFC4513] and IMAP/POP (see [RFC2195]) ๐ช. It was intended to replace the much weaker and even more dangerous Basic mechanism ๐ โโ๏ธ.
Digest Authentication offers no confidentiality protection beyond protecting the actual username and password. All of the rest of the request and response is available to an eavesdropper ๐.
It also offers only limited integrity protection for the messages in either direction. If the qop=auth-int mechanism is used, those parts of the message used in the calculation of the WWW-Authenticate and Authorization header field response parameter values (see Section 3.2 above) are protected ๐ก๏ธ. Most header fields and their values could still be modified as part of a man-in-the-middle attack ๐ฌ.
Many needs for secure HTTP transactions cannot be met by Digest Authentication. For those needs, TLS is a more appropriate protocol ๐. In particular, Digest Authentication cannot be used for any transaction requiring confidentiality protection. Nevertheless, plenty of functions remain for which Digest Authentication is both useful and appropriate ๐ธ.
5.4. Limited-Use Nonce Values โณ
The Digest scheme uses a server-specified nonce to seed the generation of the response value (as specified in Section 3.4.1 above) ๐ฑ. As shown in the example nonce in Section 3.3, the server is free to construct the nonce so that it MAY only be used from a particular client, for a particular resource, for a limited period of time or number of uses, or under any other restrictions ๐ฏ. Doing so strengthens the protection provided against, for example, replay attacks (see Section 5.5) ๐ช.
However, it should be noted that the method chosen for generating and checking the nonce also has performance and resource implications โ๏ธ. For example, a server MAY choose to allow each nonce value to be used only once, by keeping a record of whether or not each recently issued nonce has been returned and sending a next-nonce parameter in the Authentication-Info header field of every response. This protects against even an immediate replay attack, but it has a high cost due to checking nonce values. Perhaps more important, it will cause authentication failures for any pipelined requests (presumably returning a stale nonce indication) ๐ฉ.
Similarly, incorporating a request-specific element such as the ETag value for a resource limits the use of the nonce to that version of the resource, and also defeats pipelining ๐. Thus, it MAY be useful to do so for methods with side effects, but have unacceptable performance for those that do not ๐.
5.5. Replay Attacks ๐ฌ
A replay attack against Digest Authentication would usually be pointless for a simple GET request, since an eavesdropper would already have seen the only document he could obtain with a replay ๐. That's because the URI of the requested document is digested in the client request, and the server will only deliver that document. By contrast, under Basic Authentication, once the eavesdropper has the user's password, any document protected by that password is open to him ๐จ.
So for some purposes, it's necessary to protect against replay attacks ๐ง. A good Digest implementation can do this in various ways. The server-created "nonce" value is implementation dependent, but if it contains a digest of the client IP, a timestamp, the resource ETag, and a private server key (as recommended above), then a replay attack is not simple ๐. An attacker must convince the server that the request is coming from a false IP address, and must cause the server to deliver the document to an IP address different from the address to which it believes it is sending the document. An attack can only succeed in the period before the timestamp expires โฐ. Digesting the client IP and timestamp in the nonce permits an implementation that does not maintain state between transactions ๐ง .
For applications where no possibility of replay attack can be tolerated, the server can use one-time nonce values that will not be honored for a second use ๐ซ. This requires the overhead of the server remembering which nonce values have been used until the nonce timestamp (and hence the digest built with it) has expired, but it effectively protects against replay attacks ๐ก๏ธ.
An implementation must give special attention to the possibility of replay attacks with POST and PUT requests ๐ฎ. Unless the server employs one-time or otherwise limited-use nonces and/or insists on the use of the integrity protection of "qop=auth-int", an attacker could replay valid credentials from a successful request with counterfeit data or other message body ๐ฑ. Even with the use of integrity protection, most metadata in header fields is not protected. Proper nonce generation and checking provides some protection against replay of previously used valid credentials, but see Section 5.8 ๐ฅน.
5.6. Weakness Created by Multiple Authentication Schemes ๐งฉ
An HTTP/1.1 server MAY return multiple challenges with a 401 (Authenticate) response, and each challenge MAY use a different auth-scheme ๐ญ. A user agent MUST choose to use the strongest auth-scheme it understands, and request credentials from the user based upon that challenge ๐.
When the server offers choices of authentication schemes using the WWW-Authenticate header field, the strength of the resulting authentication is only as good as that of the weakest of the authentication schemes ๐. See Section 5.7 below for discussion of particular attack scenarios that exploit multiple authentication schemes ๐ต๏ธ.
5.7. Online Dictionary Attacks ๐
If the attacker can eavesdrop, then it can test any overheard nonce/response pairs against a list of common words ๐. Such a list is usually much smaller than the total number of possible passwords, and the cost of computing the response for each password on the list is paid once for each challenge ๐งพ.
The server can mitigate this attack by not allowing users to select passwords that are in a dictionary ๐ .
5.8. Man-in-the-Middle Attacks ๐ณ๏ธ
Digest Authentication is vulnerable to man-in-the-middle (MITM) attacks, for example from a hostile or compromised proxy ๐ป. Clearly, this would present all the problems of eavesdropping, but it also offers some additional opportunities to the attacker ๐ค.
A possible MITM attack would be to add a weak authentication scheme to the set of choices, hoping that the client will use one that exposes the user's credentials (e.g., password) ๐ชค. For this reason, the client SHOULD always use the strongest scheme that it understands from the choices offered ๐ช.
An even better MITM attack would be to remove all offered choices, replacing them with a challenge that requests only Basic authentication, then use the cleartext credentials from the Basic authentication to authenticate to the origin server using the stronger scheme it requested ๐. A particularly insidious way to mount such an attack would be to offer a "free" proxy caching service to gullible users ๐.
User agents should consider measures such as presenting a visual indication, at the time of the credentials request, of what authentication scheme is to be used, or remembering the strongest authentication scheme ever requested by a server and producing a warning message before using a weaker one ๐ฆ. It might also be a good idea for the user agent to be configured to demand Digest authentication in general, or from specific sites ๐.
Or, a hostile proxy might spoof the client into making a request the attacker wanted rather than one the client wanted. Of course, this is still much harder than a comparable attack against Basic Authentication ๐ฅด.
5.9. Chosen Plaintext Attacks ๐ฌ
With Digest Authentication, a MITM or a malicious server can arbitrarily choose the nonce that the client will use to compute the response ๐. This is called a "chosen plaintext" attack, and the ability to choose the nonce is known to make cryptanalysis much easier ๐งช.
However, a method to analyze the one-way functions used by Digest using chosen plaintext is not currently known ๐ค.
The countermeasure against this attack is for clients to use the cnonce parameter. This allows the client to vary the input to the hash in a way not chosen by the attacker ๐ก๏ธโจ.
5.10. Precomputed Dictionary Attacks
Okay bestie, this one is giving precomputation ๐ง With Digest Authentication, if the attacker can run a chosen plaintext attack, they can precompute the response for lots of common words against a nonce they picked, and store a dictionary of response/password pairs ๐. That precomputation can often happen in parallel across tons of machines ๐ป. Then they run the chosen plaintext attack to get the response for that challenge and just look the password up in their dictionary ๐. Even if most passwords aren't in the dictionary, some might be ๐. Since the attacker gets to pick the challenge, the cost of computing each password's response can be spread out across finding many passwords ๐ . A dictionary with 100 million password/response pairs would take about 3.2 gigabytes of disk storage ๐พ.
The countermeasure is for clients to use the cnonce parameter ๐ก๏ธ
5.11. Batch Brute-Force Attacks
Ngl this one is a whole vibe ๐ญ With Digest Authentication, a MITM can run a chosen plaintext attack and gather responses from many users to the same nonce ๐ต๏ธโโ๏ธ. Then it can find all the passwords within any subset of password space that would generate one of the nonce/response pairs in a single pass over that space ๐. It also cuts the time to find the first password by a factor equal to the number of nonce/response pairs gathered ๐. This search of the password space can often be done in parallel on many machines, and even a single machine can search large subsets of the password space very quickly. Reports exist of searching all passwords with six or fewer letters in a few hours โฐ. Iconic, but terrifying ๐
The countermeasure is for clients to use the cnonce parameter ๐ก๏ธ
5.12. Parameter Randomness
Main character energy for randomness ๐ฒ The security of this protocol is critically dependent on the randomness of the randomly chosen parameters, like client and server nonces ๐. These should be generated by a strong random or properly seeded pseudorandom source (see [RFC4086]). No shortcuts, bestie ๐
5.13. Summary
Real talk: by modern cryptographic standards, Digest Authentication is weak ๐ฅ But for a large range of purposes, it's valuable as a replacement for Basic Authentication ๐ธ. It fixes some of Basic Authentication's weaknesses, but not all of them โจ. Its strength may vary depending on the implementation ๐งฉ. In particular, the structure of the nonce (which depends on the server implementation) may affect how easy it is to mount a replay attack ๐. A range of server options is appropriate, because for example, some implementations may be willing to take on the server overhead of one-time nonces or digests to kill the possibility of replay ๐ . Others may be satisfied with a nonce like the one recommended above, i.e., restricted to a single IP address and a single ETag, or with a limited lifetime ๐ฆ.
The bottom line is that any compliant implementation will be relatively weak by cryptographic standards, but any compliant implementation will be far superior to Basic Authentication ๐
6. IANA Considerations โจ
6.1. Hash Algorithms for HTTP Digest Authentication
This spec creates a new IANA registry called "Hash Algorithms for HTTP Digest Authentication" under the existing "Hypertext Transfer Protocol (HTTP) Digest Algorithm Values" category ๐๏ธ This registry lists the hash algorithms that can be used in HTTP Digest Authentication.
When registering a new hash algorithm, the following information MUST be provided:
- Hash Algorithm: the textual name of the hash algorithm.
- Digest Size: the size of the algorithm's output in bits.
- Reference: a reference to the specification adding the algorithm to this registry.
The update policy for this registry shall be Specification Required [RFC5226] ๐
The initial registry contains the following entries:
+----------------+-------------+-----------+
| Hash Algorithm | Digest Size | Reference |
+----------------+-------------+-----------+
| "MD5" | 128 | RFC 7616 |
| "SHA-512-256" | 256 | RFC 7616 |
| "SHA-256" | 256 | RFC 7616 |
+----------------+-------------+-----------+
Each one of the algorithms in the registry might have a "-sess" variant, e.g., MD5-sess, SHA-256-sess, etc. ๐ง
To clarify the purpose of the existing "HTTP Digest Algorithm Values" registry and avoid confusion between the two registries, IANA has added the following description to that existing registry ๐
This registry lists the algorithms that can be used when creating digests of an HTTP message body, as specified in RFC 3230.
6.2. Digest Scheme Registration
This spec updates the existing entry of the Digest scheme in the "Hypertext Transfer Protocol (HTTP) Authentication Scheme Registry" and adds a new reference to this spec ๐
Authentication Scheme Name: Digest
Pointer to specification text: RFC 7616
7. References ๐
7.1. Normative References
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <http://www.rfc-editor.org/info/rfc2119>.
- [RFC2978] Freed, N. and J. Postel, "IANA Charset Registration Procedures", BCP 19, RFC 2978, DOI 10.17487/RFC2978, October 2000, <http://www.rfc-editor.org/info/rfc2978>.
- [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 2003, <http://www.rfc-editor.org/info/rfc3629>.
- [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005, <http://www.rfc-editor.org/info/rfc3986>.
- [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, DOI 10.17487/RFC4086, June 2005, <http://www.rfc-editor.org/info/rfc4086>.
- [RFC5198] Klensin, J. and M. Padlipsky, "Unicode Format for Network Interchange", RFC 5198, DOI 10.17487/RFC5198, March 2008, <http://www.rfc-editor.org/info/rfc5198>.
- [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/RFC5234, January 2008, <http://www.rfc-editor.org/info/rfc5234>.
- [RFC5987] Reschke, J., "Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters", RFC 5987, DOI 10.17487/RFC5987, August 2010, <http://www.rfc-editor.org/info/rfc5987>.
- [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, DOI 10.17487/RFC6454, December 2011, <http://www.rfc-editor.org/info/rfc6454>.
- [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, DOI 10.17487/RFC7230, June 2014, <http://www.rfc-editor.org/info/rfc7230>.
- [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, DOI 10.17487/RFC7231, June 2014, <http://www.rfc-editor.org/info/rfc7231>.
- [RFC7234] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching", RFC 7234, DOI 10.17487/RFC7234, June 2014, <http://www.rfc-editor.org/info/rfc7234>.
- [RFC7235] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Authentication", RFC 7235, DOI 10.17487/RFC7235, June 2014, <http://www.rfc-editor.org/info/rfc7235>.
- [RFC7613] Saint-Andre, P. and A. Melnikov, "Preparation, Enforcement, and Comparison of Internationalized Strings Representing Usernames and Passwords", RFC 7613, DOI 10.17487/RFC7613, August 2015, <http://www.rfc-editor.org/info/rfc7613>.
- [RFC7615] Reschke, J., "HTTP Authentication-Info and Proxy-Authentication-Info Response Header Fields", RFC 7615, DOI 10.17487/RFC7615, September 2015, <http://www.rfc-editor.org/info/rfc7615>.
7.2. Informative References
- [RFC2195] Klensin, J., Catoe, R., and P. Krumviede, "IMAP/POP AUTHorize Extension for Simple Challenge/Response", RFC 2195, DOI 10.17487/RFC2195, September 1997, <http://www.rfc-editor.org/info/rfc2195>.
- [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., Leach, P., Luotonen, A., and L. Stewart, "HTTP Authentication: Basic and Digest Access Authentication", RFC 2617, DOI 10.17487/RFC2617, June 1999, <http://www.rfc-editor.org/info/rfc2617>.
- [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, DOI 10.17487/RFC2818, May 2000, <http://www.rfc-editor.org/info/rfc2818>.
- [RFC4513] Harrison, R., Ed., "Lightweight Directory Access Protocol (LDAP): Authentication Methods and Security Mechanisms", RFC 4513, DOI 10.17487/RFC4513, June 2006, <http://www.rfc-editor.org/info/rfc4513>.
- [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 5226, DOI 10.17487/RFC5226, May 2008, <http://www.rfc-editor.org/info/rfc5226>.
- [RFC7617] Reschke, J., "The 'Basic' HTTP Authentication Scheme", RFC 7617, DOI 10.17487/RFC7617, September 2015, <http://www.rfc-editor.org/info/rfc7617>.
Appendix A. Changes from RFC 2617 ๐
This document introduces the following changes:
- Adds support for two new algorithms, SHA2-256 as mandatory and SHA2-512/256 as a backup, and defines the proper algorithm negotiation. The document keeps the MD5 algorithm support but only for backward compatibility. ๐ฅ
- Introduces the username hashing capability and the parameter associated with that, mainly for privacy reasons. ๐
- Adds various internationalization considerations that impact the A1 calculation and username and password encoding. ๐ธ
- Introduces a new IANA registry, "Hash Algorithms for HTTP Digest Authentication", that lists the hash algorithms that can be used in HTTP Digest Authentication. ๐ฆ
- Deprecates backward compatibility with RFC 2069. ๐
Acknowledgments ๐โจ
Okay bestie, this doc borrows text heavily from [RFC2617] ๐ To give a complete description of the Digest mechanism and how it works, the authors leaned on that spec a LOT. Huge thanks to John Franks, Phillip M. Hallam-Baker, Jeffery L. Hostetler, Scott D. Lawrence, Paul J. Leach, Ari Luotonen, and Lawrence C. Stewart for their work on it ๐ซถ
Special shoutout to Julian Reschke for his many reviews, comments, suggestions, and text across various areas of this doc ๐
The authors also want to thank Stephen Farrell, Yoav Nir, Phillip Hallam-Baker, Manu Sporny, Paul Hoffman, Yaron Sheffer, Sean Turner, Geoff Baskwill, Eric Cooper, Bjoern Hoehrmann, Martin Durst, Peter Saint-Andre, Michael Sweet, Daniel Stenberg, Brett Tate, Paul Leach, Ilari Liusvaara, Gary Mort, Alexey Melnikov, Benjamin Kaduk, Kathleen Moriarty, Francis Dupont, Hilarie Orman, and Ben Campbell for their careful review and comments ๐ธ
Thanks also to Jonathan Stoke, Nico Williams, Harry Halpin, and Phil Hunt for their mailing list comments while everyone was discussing different parts of this doc ๐ฌ
Paul Kyzivat and Dale Worley get a big thank you for their careful review and feedback on some aspects of the doc ๐
And Barry Leiba gets a thank you for his help with the registry ๐ฆ
Authors' Addresses ๐ฎ
These are the people who wrote it, so here's where to find them ๐ง
Rifaat Shekh-Yusef (editor) ๐
Rifaat Shekh-Yusef (editor)
Avaya
250 Sidney Street
Belleville, Ontario
Canada
Phone: +1-613-967-5267
Email: rifaat.ietf@gmail.com
David Ahrens ๐
David Ahrens
Independent
California
United States
Email: ahrensdc@gmail.com
Sophie Bremer ๐
Sophie Bremer
Netzkonform
Germany
Email: sophie.bremer@netzkonform.de
That's the whole RFC, periodt! ๐๐
๐ฆ where this page comes from
- ietf: rfc7616 2015-09
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms