idnits 2.17.1 draft-ietf-httpbis-p7-auth-19.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The draft header indicates that this document updates RFC2617, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC2617, updated by this document, for RFC5378 checks: 1997-12-01) -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 12, 2012) is 4429 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p1-messaging-19 == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p6-cache-19 -- Obsolete informational reference (is this intentional?): RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) -- Obsolete informational reference (is this intentional?): RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HTTPbis Working Group R. Fielding, Ed. 3 Internet-Draft Adobe 4 Obsoletes: 2616 (if approved) Y. Lafon, Ed. 5 Updates: 2617 (if approved) W3C 6 Intended status: Standards Track J. Reschke, Ed. 7 Expires: September 13, 2012 greenbytes 8 March 12, 2012 10 HTTP/1.1, part 7: Authentication 11 draft-ietf-httpbis-p7-auth-19 13 Abstract 15 The Hypertext Transfer Protocol (HTTP) is an application-level 16 protocol for distributed, collaborative, hypermedia information 17 systems. HTTP has been in use by the World Wide Web global 18 information initiative since 1990. This document is Part 7 of the 19 seven-part specification that defines the protocol referred to as 20 "HTTP/1.1" and, taken together, obsoletes RFC 2616. 22 Part 7 defines the HTTP Authentication framework. 24 Editorial Note (To be removed by RFC Editor) 26 Discussion of this draft should take place on the HTTPBIS working 27 group mailing list (ietf-http-wg@w3.org), which is archived at 28 . 30 The current issues list is at 31 and related 32 documents (including fancy diffs) can be found at 33 . 35 The changes in this draft are summarized in Appendix C.20. 37 Status of This Memo 39 This Internet-Draft is submitted in full conformance with the 40 provisions of BCP 78 and BCP 79. 42 Internet-Drafts are working documents of the Internet Engineering 43 Task Force (IETF). Note that other groups may also distribute 44 working documents as Internet-Drafts. The list of current Internet- 45 Drafts is at http://datatracker.ietf.org/drafts/current/. 47 Internet-Drafts are draft documents valid for a maximum of six months 48 and may be updated, replaced, or obsoleted by other documents at any 49 time. It is inappropriate to use Internet-Drafts as reference 50 material or to cite them other than as "work in progress." 52 This Internet-Draft will expire on September 13, 2012. 54 Copyright Notice 56 Copyright (c) 2012 IETF Trust and the persons identified as the 57 document authors. All rights reserved. 59 This document is subject to BCP 78 and the IETF Trust's Legal 60 Provisions Relating to IETF Documents 61 (http://trustee.ietf.org/license-info) in effect on the date of 62 publication of this document. Please review these documents 63 carefully, as they describe your rights and restrictions with respect 64 to this document. Code Components extracted from this document must 65 include Simplified BSD License text as described in Section 4.e of 66 the Trust Legal Provisions and are provided without warranty as 67 described in the Simplified BSD License. 69 This document may contain material from IETF Documents or IETF 70 Contributions published or made publicly available before November 71 10, 2008. The person(s) controlling the copyright in some of this 72 material may not have granted the IETF Trust the right to allow 73 modifications of such material outside the IETF Standards Process. 74 Without obtaining an adequate license from the person(s) controlling 75 the copyright in such materials, this document may not be modified 76 outside the IETF Standards Process, and derivative works of it may 77 not be created outside the IETF Standards Process, except to format 78 it for publication as an RFC or to translate it into languages other 79 than English. 81 Table of Contents 83 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 84 1.1. Conformance and Error Handling . . . . . . . . . . . . . . 4 85 1.2. Syntax Notation . . . . . . . . . . . . . . . . . . . . . 4 86 1.2.1. Core Rules . . . . . . . . . . . . . . . . . . . . . . 5 87 2. Access Authentication Framework . . . . . . . . . . . . . . . 5 88 2.1. Challenge and Response . . . . . . . . . . . . . . . . . . 5 89 2.2. Protection Space (Realm) . . . . . . . . . . . . . . . . . 7 90 2.3. Authentication Scheme Registry . . . . . . . . . . . . . . 7 91 2.3.1. Considerations for New Authentication Schemes . . . . 8 92 3. Status Code Definitions . . . . . . . . . . . . . . . . . . . 9 93 3.1. 401 Unauthorized . . . . . . . . . . . . . . . . . . . . . 9 94 3.2. 407 Proxy Authentication Required . . . . . . . . . . . . 9 95 4. Header Field Definitions . . . . . . . . . . . . . . . . . . . 10 96 4.1. Authorization . . . . . . . . . . . . . . . . . . . . . . 10 97 4.2. Proxy-Authenticate . . . . . . . . . . . . . . . . . . . . 11 98 4.3. Proxy-Authorization . . . . . . . . . . . . . . . . . . . 11 99 4.4. WWW-Authenticate . . . . . . . . . . . . . . . . . . . . . 11 100 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 101 5.1. Authenticaton Scheme Registry . . . . . . . . . . . . . . 12 102 5.2. Status Code Registration . . . . . . . . . . . . . . . . . 12 103 5.3. Header Field Registration . . . . . . . . . . . . . . . . 13 104 6. Security Considerations . . . . . . . . . . . . . . . . . . . 13 105 6.1. Authentication Credentials and Idle Clients . . . . . . . 13 106 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 14 107 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 14 108 8.1. Normative References . . . . . . . . . . . . . . . . . . . 14 109 8.2. Informative References . . . . . . . . . . . . . . . . . . 14 110 Appendix A. Changes from RFCs 2616 and 2617 . . . . . . . . . . . 15 111 Appendix B. Collected ABNF . . . . . . . . . . . . . . . . . . . 16 112 Appendix C. Change Log (to be removed by RFC Editor before 113 publication) . . . . . . . . . . . . . . . . . . . . 16 114 C.1. Since RFC 2616 . . . . . . . . . . . . . . . . . . . . . . 16 115 C.2. Since draft-ietf-httpbis-p7-auth-00 . . . . . . . . . . . 16 116 C.3. Since draft-ietf-httpbis-p7-auth-01 . . . . . . . . . . . 17 117 C.4. Since draft-ietf-httpbis-p7-auth-02 . . . . . . . . . . . 17 118 C.5. Since draft-ietf-httpbis-p7-auth-03 . . . . . . . . . . . 17 119 C.6. Since draft-ietf-httpbis-p7-auth-04 . . . . . . . . . . . 17 120 C.7. Since draft-ietf-httpbis-p7-auth-05 . . . . . . . . . . . 17 121 C.8. Since draft-ietf-httpbis-p7-auth-06 . . . . . . . . . . . 18 122 C.9. Since draft-ietf-httpbis-p7-auth-07 . . . . . . . . . . . 18 123 C.10. Since draft-ietf-httpbis-p7-auth-08 . . . . . . . . . . . 18 124 C.11. Since draft-ietf-httpbis-p7-auth-09 . . . . . . . . . . . 18 125 C.12. Since draft-ietf-httpbis-p7-auth-10 . . . . . . . . . . . 18 126 C.13. Since draft-ietf-httpbis-p7-auth-11 . . . . . . . . . . . 18 127 C.14. Since draft-ietf-httpbis-p7-auth-12 . . . . . . . . . . . 19 128 C.15. Since draft-ietf-httpbis-p7-auth-13 . . . . . . . . . . . 19 129 C.16. Since draft-ietf-httpbis-p7-auth-14 . . . . . . . . . . . 19 130 C.17. Since draft-ietf-httpbis-p7-auth-15 . . . . . . . . . . . 19 131 C.18. Since draft-ietf-httpbis-p7-auth-16 . . . . . . . . . . . 19 132 C.19. Since draft-ietf-httpbis-p7-auth-17 . . . . . . . . . . . 20 133 C.20. Since draft-ietf-httpbis-p7-auth-18 . . . . . . . . . . . 20 134 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 136 1. Introduction 138 This document defines HTTP/1.1 access control and authentication. It 139 includes the relevant parts of RFC 2616 with only minor changes, plus 140 the general framework for HTTP authentication, as previously defined 141 in "HTTP Authentication: Basic and Digest Access Authentication" 142 ([RFC2617]). 144 HTTP provides several OPTIONAL challenge-response authentication 145 mechanisms which can be used by a server to challenge a client 146 request and by a client to provide authentication information. The 147 "basic" and "digest" authentication schemes continue to be specified 148 in RFC 2617. 150 1.1. Conformance and Error Handling 152 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 153 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 154 document are to be interpreted as described in [RFC2119]. 156 This document defines conformance criteria for several roles in HTTP 157 communication, including Senders, Recipients, Clients, Servers, User- 158 Agents, Origin Servers, Intermediaries, Proxies and Gateways. See 159 Section 2 of [Part1] for definitions of these terms. 161 An implementation is considered conformant if it complies with all of 162 the requirements associated with its role(s). Note that SHOULD-level 163 requirements are relevant here, unless one of the documented 164 exceptions is applicable. 166 This document also uses ABNF to define valid protocol elements 167 (Section 1.2). In addition to the prose requirements placed upon 168 them, Senders MUST NOT generate protocol elements that are invalid. 170 Unless noted otherwise, Recipients MAY take steps to recover a usable 171 protocol element from an invalid construct. However, HTTP does not 172 define specific error handling mechanisms, except in cases where it 173 has direct impact on security. This is because different uses of the 174 protocol require different error handling strategies; for example, a 175 Web browser may wish to transparently recover from a response where 176 the Location header field doesn't parse according to the ABNF, 177 whereby in a systems control protocol using HTTP, this type of error 178 recovery could lead to dangerous consequences. 180 1.2. Syntax Notation 182 This specification uses the Augmented Backus-Naur Form (ABNF) 183 notation of [RFC5234] with the list rule extension defined in Section 184 1.2 of [Part1]. Appendix B shows the collected ABNF with the list 185 rule expanded. 187 The following core rules are included by reference, as defined in 188 [RFC5234], Appendix B.1: ALPHA (letters), CR (carriage return), CRLF 189 (CR LF), CTL (controls), DIGIT (decimal 0-9), DQUOTE (double quote), 190 HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed), OCTET (any 8-bit 191 sequence of data), SP (space), and VCHAR (any visible US-ASCII 192 character). 194 1.2.1. Core Rules 196 The core rules below are defined in [Part1]: 198 BWS = 199 OWS = 200 quoted-string = 201 token = 203 2. Access Authentication Framework 205 2.1. Challenge and Response 207 HTTP provides a simple challenge-response authentication mechanism 208 that can be used by a server to challenge a client request and by a 209 client to provide authentication information. It uses an extensible, 210 case-insensitive token to identify the authentication scheme, 211 followed by additional information necessary for achieving 212 authentication via that scheme. The latter can either be a comma- 213 separated list of parameters or a single sequence of characters 214 capable of holding base64-encoded information. 216 Parameters are name-value pairs where the name is matched case- 217 insensitively, and each parameter name MUST only occur once per 218 challenge. 220 auth-scheme = token 222 auth-param = token BWS "=" BWS ( token / quoted-string ) 224 b64token = 1*( ALPHA / DIGIT / 225 "-" / "." / "_" / "~" / "+" / "/" ) *"=" 227 The "b64token" syntax allows the 66 unreserved URI characters 228 ([RFC3986]), plus a few others, so that it can hold a base64, 229 base64url (URL and filename safe alphabet), base32, or base16 (hex) 230 encoding, with or without padding, but excluding whitespace 231 ([RFC4648]). 233 The 401 (Unauthorized) response message is used by an origin server 234 to challenge the authorization of a user agent. This response MUST 235 include a WWW-Authenticate header field containing at least one 236 challenge applicable to the requested resource. 238 The 407 (Proxy Authentication Required) response message is used by a 239 proxy to challenge the authorization of a client and MUST include a 240 Proxy-Authenticate header field containing at least one challenge 241 applicable to the proxy for the requested resource. 243 challenge = auth-scheme [ 1*SP ( b64token / #auth-param ) ] 245 Note: User agents will need to take special care in parsing the 246 WWW-Authenticate and Proxy-Authenticate header field values 247 because they can contain more than one challenge, or if more than 248 one of each is provided, since the contents of a challenge can 249 itself contain a comma-separated list of authentication 250 parameters. 252 Note: Many browsers fail to parse challenges containing unknown 253 schemes. A workaround for this problem is to list well-supported 254 schemes (such as "basic") first. 256 A user agent that wishes to authenticate itself with an origin server 257 -- usually, but not necessarily, after receiving a 401 (Unauthorized) 258 -- MAY do so by including an Authorization header field with the 259 request. 261 A client that wishes to authenticate itself with a proxy -- usually, 262 but not necessarily, after receiving a 407 (Proxy Authentication 263 Required) -- MAY do so by including a Proxy-Authorization header 264 field with the request. 266 Both the Authorization field value and the Proxy-Authorization field 267 value consist of credentials containing the authentication 268 information of the client for the realm of the resource being 269 requested. The user agent MUST choose to use one of the challenges 270 with the strongest auth-scheme it understands and request credentials 271 from the user based upon that challenge. 273 credentials = auth-scheme [ 1*SP ( b64token / #auth-param ) ] 275 If the origin server does not wish to accept the credentials sent 276 with a request, it SHOULD return a 401 (Unauthorized) response. The 277 response MUST include a WWW-Authenticate header field containing at 278 least one (possibly new) challenge applicable to the requested 279 resource. 281 If a proxy does not accept the credentials sent with a request, it 282 SHOULD return a 407 (Proxy Authentication Required). The response 283 MUST include a Proxy-Authenticate header field containing a (possibly 284 new) challenge applicable to the proxy for the requested resource. 286 The HTTP protocol does not restrict applications to this simple 287 challenge-response mechanism for access authentication. Additional 288 mechanisms MAY be used, such as encryption at the transport level or 289 via message encapsulation, and with additional header fields 290 specifying authentication information. However, such additional 291 mechanisms are not defined by this specification. 293 Proxies MUST forward the WWW-Authenticate and Authorization headers 294 unmodified and follow the rules found in Section 4.1. 296 2.2. Protection Space (Realm) 298 The authentication parameter realm is reserved for use by 299 authentication schemes that wish to indicate the scope of protection. 301 A protection space is defined by the canonical root URI (the scheme 302 and authority components of the effective request URI; see Section 303 5.5 of [Part1]) of the server being accessed, in combination with the 304 realm value if present. These realms allow the protected resources 305 on a server to be partitioned into a set of protection spaces, each 306 with its own authentication scheme and/or authorization database. 307 The realm value is a string, generally assigned by the origin server, 308 which can have additional semantics specific to the authentication 309 scheme. Note that there can be multiple challenges with the same 310 auth-scheme but different realms. 312 The protection space determines the domain over which credentials can 313 be automatically applied. If a prior request has been authorized, 314 the same credentials MAY be reused for all other requests within that 315 protection space for a period of time determined by the 316 authentication scheme, parameters, and/or user preference. Unless 317 otherwise defined by the authentication scheme, a single protection 318 space cannot extend outside the scope of its server. 320 For historical reasons, senders MUST only use the quoted-string 321 syntax. Recipients might have to support both token and quoted- 322 string syntax for maximum interoperability with existing clients that 323 have been accepting both notations for a long time. 325 2.3. Authentication Scheme Registry 327 The HTTP Authentication Scheme Registry defines the name space for 328 the authentication schemes in challenges and credentials. 330 Registrations MUST include the following fields: 332 o Authentication Scheme Name 334 o Pointer to specification text 336 o Notes (optional) 338 Values to be added to this name space require IETF Review (see 339 [RFC5226], Section 4.1). 341 The registry itself is maintained at 342 . 344 2.3.1. Considerations for New Authentication Schemes 346 There are certain aspects of the HTTP Authentication Framework that 347 put constraints on how new authentication schemes can work: 349 o HTTP authentication is presumed to be stateless: all of the 350 information necessary to authenticate a request MUST be provided 351 in the request, rather than be dependent on the server remembering 352 prior requests. Authentication based on, or bound to, the 353 underlying connection is outside the scope of this specification 354 and inherently flawed unless steps are taken to ensure that the 355 connection cannot be used by any party other than the 356 authenticated user (see Section 2.3 of [Part1]). 358 o The authentication parameter "realm" is reserved for defining 359 Protection Spaces as defined in Section 2.2. New schemes MUST NOT 360 use it in a way incompatible with that definition. 362 o The "b64token" notation was introduced for compatibility with 363 existing authentication schemes and can only be used once per 364 challenge/credentials. New schemes thus ought to use the "auth- 365 param" syntax instead, because otherwise future extensions will be 366 impossible. 368 o The parsing of challenges and credentials is defined by this 369 specification, and cannot be modified by new authentication 370 schemes. When the auth-param syntax is used, all parameters ought 371 to support both token and quoted-string syntax, and syntactical 372 constraints ought to be defined on the field value after parsing 373 (i.e., quoted-string processing). This is necessary so that 374 recipients can use a generic parser that applies to all 375 authentication schemes. 377 Note: the fact that the value syntax for the "realm" parameter is 378 restricted to quoted-string was a bad design choice not to be 379 repeated for new parameters. 381 o Definitions of new schemes ought to define the treatment of 382 unknown extension parameters. In general, a "must-ignore" rule is 383 preferable over "must-understand", because otherwise it will be 384 hard to introduce new parameters in the presence of legacy 385 recipients. Furthermore, it's good to describe the policy for 386 defining new parameters (such as "update the specification", or 387 "use this registry"). 389 o Authentication schemes need to document whether they are usable in 390 origin-server authentication (i.e., using WWW-Authenticate), 391 and/or proxy authentication (i.e., using Proxy-Authenticate). 393 o The credentials carried in an Authorization header field are 394 specific to the User Agent, and therefore have the same effect on 395 HTTP caches as the "private" Cache-Control response directive, 396 within the scope of the request they appear in. 398 Therefore, new authentication schemes which choose not to carry 399 credentials in the Authorization header (e.g., using a newly 400 defined header) will need to explicitly disallow caching, by 401 mandating the use of either Cache-Control request directives 402 (e.g., "no-store") or response directives (e.g., "private"). 404 3. Status Code Definitions 406 3.1. 401 Unauthorized 408 The request requires user authentication. The response MUST include 409 a WWW-Authenticate header field (Section 4.4) containing a challenge 410 applicable to the target resource. The client MAY repeat the request 411 with a suitable Authorization header field (Section 4.1). If the 412 request already included Authorization credentials, then the 401 413 response indicates that authorization has been refused for those 414 credentials. If the 401 response contains the same challenge as the 415 prior response, and the user agent has already attempted 416 authentication at least once, then the user SHOULD be presented the 417 representation that was given in the response, since that 418 representation might include relevant diagnostic information. 420 3.2. 407 Proxy Authentication Required 422 This code is similar to 401 (Unauthorized), but indicates that the 423 client ought to first authenticate itself with the proxy. The proxy 424 MUST return a Proxy-Authenticate header field (Section 4.2) 425 containing a challenge applicable to the proxy for the target 426 resource. The client MAY repeat the request with a suitable Proxy- 427 Authorization header field (Section 4.3). 429 4. Header Field Definitions 431 This section defines the syntax and semantics of HTTP/1.1 header 432 fields related to authentication. 434 4.1. Authorization 436 The "Authorization" header field allows a user agent to authenticate 437 itself with a server -- usually, but not necessarily, after receiving 438 a 401 (Unauthorized) response. Its value consists of credentials 439 containing information of the user agent for the realm of the 440 resource being requested. 442 Authorization = credentials 444 If a request is authenticated and a realm specified, the same 445 credentials SHOULD be valid for all other requests within this realm 446 (assuming that the authentication scheme itself does not require 447 otherwise, such as credentials that vary according to a challenge 448 value or using synchronized clocks). 450 When a shared cache (see Section 1.2 of [Part6]) receives a request 451 containing an Authorization field, it MUST NOT return the 452 corresponding response as a reply to any other request, unless one of 453 the following specific exceptions holds: 455 1. If the response includes the "s-maxage" cache-control directive, 456 the cache MAY use that response in replying to a subsequent 457 request. But (if the specified maximum age has passed) a proxy 458 cache MUST first revalidate it with the origin server, using the 459 header fields from the new request to allow the origin server to 460 authenticate the new request. (This is the defined behavior for 461 s-maxage.) If the response includes "s-maxage=0", the proxy MUST 462 always revalidate it before re-using it. 464 2. If the response includes the "must-revalidate" cache-control 465 directive, the cache MAY use that response in replying to a 466 subsequent request. But if the response is stale, all caches 467 MUST first revalidate it with the origin server, using the header 468 fields from the new request to allow the origin server to 469 authenticate the new request. 471 3. If the response includes the "public" cache-control directive, it 472 MAY be returned in reply to any subsequent request. 474 4.2. Proxy-Authenticate 476 The "Proxy-Authenticate" header field consists of a challenge that 477 indicates the authentication scheme and parameters applicable to the 478 proxy for this effective request URI (Section 5.5 of [Part1]). It 479 MUST be included as part of a 407 (Proxy Authentication Required) 480 response. 482 Proxy-Authenticate = 1#challenge 484 Unlike WWW-Authenticate, the Proxy-Authenticate header field applies 485 only to the current connection and SHOULD NOT be passed on to 486 downstream clients. However, an intermediate proxy might need to 487 obtain its own credentials by requesting them from the downstream 488 client, which in some circumstances will appear as if the proxy is 489 forwarding the Proxy-Authenticate header field. 491 Note that the parsing considerations for WWW-Authenticate apply to 492 this header field as well; see Section 4.4 for details. 494 4.3. Proxy-Authorization 496 The "Proxy-Authorization" header field allows the client to identify 497 itself (or its user) to a proxy which requires authentication. Its 498 value consists of credentials containing the authentication 499 information of the user agent for the proxy and/or realm of the 500 resource being requested. 502 Proxy-Authorization = credentials 504 Unlike Authorization, the Proxy-Authorization header field applies 505 only to the next outbound proxy that demanded authentication using 506 the Proxy-Authenticate field. When multiple proxies are used in a 507 chain, the Proxy-Authorization header field is consumed by the first 508 outbound proxy that was expecting to receive credentials. A proxy 509 MAY relay the credentials from the client request to the next proxy 510 if that is the mechanism by which the proxies cooperatively 511 authenticate a given request. 513 4.4. WWW-Authenticate 515 The "WWW-Authenticate" header field consists of at least one 516 challenge that indicates the authentication scheme(s) and parameters 517 applicable to the effective request URI (Section 5.5 of [Part1]). 519 It MUST be included in 401 (Unauthorized) response messages and MAY 520 be included in other response messages to indicate that supplying 521 credentials (or different credentials) might affect the response. 523 WWW-Authenticate = 1#challenge 525 User agents are advised to take special care in parsing the WWW- 526 Authenticate field value as it might contain more than one challenge, 527 or if more than one WWW-Authenticate header field is provided, the 528 contents of a challenge itself can contain a comma-separated list of 529 authentication parameters. 531 For instance: 533 WWW-Authenticate: Newauth realm="apps", type=1, 534 title="Login to \"apps\"", Basic realm="simple" 536 This header field contains two challenges; one for the "Newauth" 537 scheme with a realm value of "apps", and two additional parameters 538 "type" and "title", and another one for the "Basic" scheme with a 539 realm value of "simple". 541 Note: The challenge grammar production uses the list syntax as 542 well. Therefore, a sequence of comma, whitespace, and comma can 543 be considered both as applying to the preceding challenge, or to 544 be an empty entry in the list of challenges. In practice, this 545 ambiguity does not affect the semantics of the header field value 546 and thus is harmless. 548 5. IANA Considerations 550 5.1. Authenticaton Scheme Registry 552 The registration procedure for HTTP Authentication Schemes is defined 553 by Section 2.3 of this document. 555 The HTTP Method Authentication Scheme shall be created at 556 . 558 5.2. Status Code Registration 560 The HTTP Status Code Registry located at 561 shall be updated 562 with the registrations below: 564 +-------+-------------------------------+-------------+ 565 | Value | Description | Reference | 566 +-------+-------------------------------+-------------+ 567 | 401 | Unauthorized | Section 3.1 | 568 | 407 | Proxy Authentication Required | Section 3.2 | 569 +-------+-------------------------------+-------------+ 571 5.3. Header Field Registration 573 The Message Header Field Registry located at shall be 575 updated with the permanent registrations below (see [RFC3864]): 577 +---------------------+----------+----------+-------------+ 578 | Header Field Name | Protocol | Status | Reference | 579 +---------------------+----------+----------+-------------+ 580 | Authorization | http | standard | Section 4.1 | 581 | Proxy-Authenticate | http | standard | Section 4.2 | 582 | Proxy-Authorization | http | standard | Section 4.3 | 583 | WWW-Authenticate | http | standard | Section 4.4 | 584 +---------------------+----------+----------+-------------+ 586 The change controller is: "IETF (iesg@ietf.org) - Internet 587 Engineering Task Force". 589 6. Security Considerations 591 This section is meant to inform application developers, information 592 providers, and users of the security limitations in HTTP/1.1 as 593 described by this document. The discussion does not include 594 definitive solutions to the problems revealed, though it does make 595 some suggestions for reducing security risks. 597 6.1. Authentication Credentials and Idle Clients 599 Existing HTTP clients and user agents typically retain authentication 600 information indefinitely. HTTP/1.1 does not provide a method for a 601 server to direct clients to discard these cached credentials. This 602 is a significant defect that requires further extensions to HTTP. 603 Circumstances under which credential caching can interfere with the 604 application's security model include but are not limited to: 606 o Clients which have been idle for an extended period following 607 which the server might wish to cause the client to reprompt the 608 user for credentials. 610 o Applications which include a session termination indication (such 611 as a "logout" or "commit" button on a page) after which the server 612 side of the application "knows" that there is no further reason 613 for the client to retain the credentials. 615 This is currently under separate study. There are a number of work- 616 arounds to parts of this problem, and we encourage the use of 617 password protection in screen savers, idle time-outs, and other 618 methods which mitigate the security problems inherent in this 619 problem. In particular, user agents which cache credentials are 620 encouraged to provide a readily accessible mechanism for discarding 621 cached credentials under user control. 623 7. Acknowledgments 625 This specification takes over the definition of the HTTP 626 Authentication Framework, previously defined in RFC 2617. We thank 627 John Franks, Phillip M. Hallam-Baker, Jeffery L. Hostetler, Scott D. 628 Lawrence, Paul J. Leach, Ari Luotonen, and Lawrence C. Stewart for 629 their work on that specification. See Section 6 of [RFC2617] for 630 further acknowledgements. 632 See Section 9 of [Part1] for the Acknowledgments related to this 633 document revision. 635 8. References 637 8.1. Normative References 639 [Part1] Fielding, R., Ed., Lafon, Y., Ed., and J. Reschke, Ed., 640 "HTTP/1.1, part 1: URIs, Connections, and Message 641 Parsing", draft-ietf-httpbis-p1-messaging-19 (work in 642 progress), March 2012. 644 [Part6] Fielding, R., Ed., Lafon, Y., Ed., Nottingham, M., Ed., 645 and J. Reschke, Ed., "HTTP/1.1, part 6: Caching", 646 draft-ietf-httpbis-p6-cache-19 (work in progress), 647 March 2012. 649 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 650 Requirement Levels", BCP 14, RFC 2119, March 1997. 652 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 653 Specifications: ABNF", STD 68, RFC 5234, January 2008. 655 8.2. Informative References 657 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 658 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 659 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 661 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 662 Leach, P., Luotonen, A., and L. Stewart, "HTTP 663 Authentication: Basic and Digest Access Authentication", 664 RFC 2617, June 1999. 666 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 667 Procedures for Message Header Fields", BCP 90, RFC 3864, 668 September 2004. 670 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 671 Resource Identifier (URI): Generic Syntax", STD 66, 672 RFC 3986, January 2005. 674 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 675 Encodings", RFC 4648, October 2006. 677 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 678 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 679 May 2008. 681 Appendix A. Changes from RFCs 2616 and 2617 683 The "realm" parameter isn't required anymore in general; 684 consequently, the ABNF allows challenges without any auth parameters. 685 (Section 2) 687 The "b64token" alternative to auth-param lists has been added for 688 consistency with legacy authentication schemes such as "Basic". 689 (Section 2) 691 Change ABNF productions for header fields to only define the field 692 value. (Section 4) 694 Appendix B. Collected ABNF 696 Authorization = credentials 698 BWS = 700 OWS = 702 Proxy-Authenticate = *( "," OWS ) challenge *( OWS "," [ OWS 703 challenge ] ) 704 Proxy-Authorization = credentials 706 WWW-Authenticate = *( "," OWS ) challenge *( OWS "," [ OWS challenge 707 ] ) 709 auth-param = token BWS "=" BWS ( token / quoted-string ) 710 auth-scheme = token 712 b64token = 1*( ALPHA / DIGIT / "-" / "." / "_" / "~" / "+" / "/" ) 713 *"=" 715 challenge = auth-scheme [ 1*SP ( b64token / [ ( "," / auth-param ) *( 716 OWS "," [ OWS auth-param ] ) ] ) ] 717 credentials = auth-scheme [ 1*SP ( b64token / [ ( "," / auth-param ) 718 *( OWS "," [ OWS auth-param ] ) ] ) ] 720 quoted-string = 722 token = 724 ABNF diagnostics: 726 ; Authorization defined but not used 727 ; Proxy-Authenticate defined but not used 728 ; Proxy-Authorization defined but not used 729 ; WWW-Authenticate defined but not used 731 Appendix C. Change Log (to be removed by RFC Editor before publication) 733 C.1. Since RFC 2616 735 Extracted relevant partitions from [RFC2616]. 737 C.2. Since draft-ietf-httpbis-p7-auth-00 739 Closed issues: 741 o : "Normative and 742 Informative references" 744 C.3. Since draft-ietf-httpbis-p7-auth-01 746 Ongoing work on ABNF conversion 747 (): 749 o Explicitly import BNF rules for "challenge" and "credentials" from 750 RFC2617. 752 o Add explicit references to BNF syntax and rules imported from 753 other parts of the specification. 755 C.4. Since draft-ietf-httpbis-p7-auth-02 757 Ongoing work on IANA Message Header Field Registration 758 (): 760 o Reference RFC 3984, and update header field registrations for 761 header fields defined in this document. 763 C.5. Since draft-ietf-httpbis-p7-auth-03 765 None. 767 C.6. Since draft-ietf-httpbis-p7-auth-04 769 Ongoing work on ABNF conversion 770 (): 772 o Use "/" instead of "|" for alternatives. 774 o Introduce new ABNF rules for "bad" whitespace ("BWS"), optional 775 whitespace ("OWS") and required whitespace ("RWS"). 777 o Rewrite ABNFs to spell out whitespace rules, factor out header 778 field value format definitions. 780 C.7. Since draft-ietf-httpbis-p7-auth-05 782 Final work on ABNF conversion 783 (): 785 o Add appendix containing collected and expanded ABNF, reorganize 786 ABNF introduction. 788 C.8. Since draft-ietf-httpbis-p7-auth-06 790 None. 792 C.9. Since draft-ietf-httpbis-p7-auth-07 794 Closed issues: 796 o : "move IANA 797 registrations for optional status codes" 799 C.10. Since draft-ietf-httpbis-p7-auth-08 801 No significant changes. 803 C.11. Since draft-ietf-httpbis-p7-auth-09 805 Partly resolved issues: 807 o : "Term for the 808 requested resource's URI" 810 C.12. Since draft-ietf-httpbis-p7-auth-10 812 None. 814 C.13. Since draft-ietf-httpbis-p7-auth-11 816 Closed issues: 818 o : "introduction 819 to part 7 is work-in-progress" 821 o : "auth-param 822 syntax" 824 o : "Header 825 Classification" 827 o : "absorbing the 828 auth framework from 2617" 830 Partly resolved issues: 832 o : "should we 833 have an auth scheme registry" 835 C.14. Since draft-ietf-httpbis-p7-auth-12 837 None. 839 C.15. Since draft-ietf-httpbis-p7-auth-13 841 Closed issues: 843 o : "untangle 844 ABNFs for header fields" 846 C.16. Since draft-ietf-httpbis-p7-auth-14 848 None. 850 C.17. Since draft-ietf-httpbis-p7-auth-15 852 Closed issues: 854 o : "Relationship 855 between 401, Authorization and WWW-Authenticate" 857 o : "Realm 858 required on challenges" 860 o : "auth-param 861 syntax" 863 o : 864 "Considerations for new authentications schemes" 866 o : "LWS in auth- 867 param ABNF" 869 o : "credentials 870 ABNF missing SP (still using implied LWS?)" 872 C.18. Since draft-ietf-httpbis-p7-auth-16 874 Closed issues: 876 o : "Document 877 HTTP's error-handling philosophy" 879 o : "add advice on 880 defining auth scheme parameters" 882 C.19. Since draft-ietf-httpbis-p7-auth-17 884 Closed issues: 886 o : "allow 887 unquoted realm parameters" 889 o : "Repeating 890 auth-params" 892 C.20. Since draft-ietf-httpbis-p7-auth-18 894 Closed issues: 896 o : "recipient 897 behavior for new auth parameters" 899 o : "WWW- 900 Authenticate ABNF slightly ambiguous" 902 Index 904 4 905 401 Unauthorized (status code) 9 906 407 Proxy Authentication Required (status code) 9 908 A 909 auth-param 5 910 auth-scheme 5 911 Authorization header field 10 913 B 914 b64token 5 916 C 917 challenge 6 918 credentials 6 920 G 921 Grammar 922 auth-param 5 923 auth-scheme 5 924 Authorization 10 925 b64token 5 926 challenge 6 927 credentials 6 928 Proxy-Authenticate 11 929 Proxy-Authorization 11 930 WWW-Authenticate 12 932 H 933 Header Fields 934 Authorization 10 935 Proxy-Authenticate 11 936 Proxy-Authorization 11 937 WWW-Authenticate 11 939 P 940 Protection Space 7 941 Proxy-Authenticate header field 11 942 Proxy-Authorization header field 11 944 R 945 Realm 7 947 S 948 Status Codes 949 401 Unauthorized 9 950 407 Proxy Authentication Required 9 952 W 953 WWW-Authenticate header field 11 955 Authors' Addresses 957 Roy T. Fielding (editor) 958 Adobe Systems Incorporated 959 345 Park Ave 960 San Jose, CA 95110 961 USA 963 EMail: fielding@gbiv.com 964 URI: http://roy.gbiv.com/ 966 Yves Lafon (editor) 967 World Wide Web Consortium 968 W3C / ERCIM 969 2004, rte des Lucioles 970 Sophia-Antipolis, AM 06902 971 France 973 EMail: ylafon@w3.org 974 URI: http://www.raubacapeu.net/people/yves/ 975 Julian F. Reschke (editor) 976 greenbytes GmbH 977 Hafenweg 16 978 Muenster, NW 48155 979 Germany 981 Phone: +49 251 2807760 982 Fax: +49 251 2807761 983 EMail: julian.reschke@greenbytes.de 984 URI: http://greenbytes.de/tech/webdav/