idnits 2.17.1 draft-ietf-httpauth-basicauth-enc-01.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 directly say this. It does mention RFC2617 though, so this could be OK. 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 lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (June 30, 2013) is 3925 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) -- Obsolete informational reference (is this intentional?): RFC 2831 (Obsoleted by RFC 6331) Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HTTPAuth Working Group J. Reschke 3 Internet-Draft greenbytes 4 Updates: 2617 (if approved) June 30, 2013 5 Intended status: Experimental 6 Expires: January 1, 2014 8 An Encoding Parameter for HTTP Basic Authentication 9 draft-ietf-httpauth-basicauth-enc-01 11 Abstract 13 The "Basic" authentication scheme defined in RFC 2617 does not 14 properly define how to treat non-ASCII characters. This has led to a 15 situation where user agent implementations disagree, and servers make 16 different assumptions based on the locales they are running in. 17 There is little interoperability for the non-ASCII characters in the 18 ISO-8859-1 character repertoire, and even less interoperability for 19 any characters beyond that. 21 This document defines a backwards-compatible extension to "Basic", 22 specifying the server's character encoding scheme expectation, using 23 a new authentication scheme parameter. 25 Editorial Note (To be removed by RFC Editor before publication) 27 Discussion of this draft takes place on the HTTPAuth working group 28 mailing list (http-auth@ietf.org), which is archived at . 31 XML versions, latest edits and the issues list for this document are 32 available from 33 . 36 The changes in this draft are summarized in Appendix C.9. 38 Status of This Memo 40 This Internet-Draft is submitted in full conformance with the 41 provisions of BCP 78 and BCP 79. 43 Internet-Drafts are working documents of the Internet Engineering 44 Task Force (IETF). Note that other groups may also distribute 45 working documents as Internet-Drafts. The list of current Internet- 46 Drafts is at http://datatracker.ietf.org/drafts/current/. 48 Internet-Drafts are draft documents valid for a maximum of six months 49 and may be updated, replaced, or obsoleted by other documents at any 50 time. It is inappropriate to use Internet-Drafts as reference 51 material or to cite them other than as "work in progress." 53 This Internet-Draft will expire on January 1, 2014. 55 Copyright Notice 57 Copyright (c) 2013 IETF Trust and the persons identified as the 58 document authors. All rights reserved. 60 This document is subject to BCP 78 and the IETF Trust's Legal 61 Provisions Relating to IETF Documents 62 (http://trustee.ietf.org/license-info) in effect on the date of 63 publication of this document. Please review these documents 64 carefully, as they describe your rights and restrictions with respect 65 to this document. Code Components extracted from this document must 66 include Simplified BSD License text as described in Section 4.e of 67 the Trust Legal Provisions and are provided without warranty as 68 described in the Simplified BSD License. 70 Table of Contents 72 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 73 2. Notational Conventions . . . . . . . . . . . . . . . . . . . . 4 74 3. The 'charset' auth-param . . . . . . . . . . . . . . . . . . . 4 75 4. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 76 5. Security Considerations . . . . . . . . . . . . . . . . . . . 5 77 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 78 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 6 79 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 6 80 8.1. Normative References . . . . . . . . . . . . . . . . . . . 6 81 8.2. Informative References . . . . . . . . . . . . . . . . . . 7 82 Appendix A. Deployment Considerations . . . . . . . . . . . . . . 7 83 A.1. User Agents . . . . . . . . . . . . . . . . . . . . . . . 7 84 A.1.1. Alternative approach . . . . . . . . . . . . . . . . . 7 85 A.2. Origin Servers . . . . . . . . . . . . . . . . . . . . . . 8 86 Appendix B. FAQ (to be removed by RFC Editor before 87 publication) . . . . . . . . . . . . . . . . . . . . 8 88 B.1. Why not simply switch the default encoding to UTF-8? . . . 8 89 B.2. What about Digest? . . . . . . . . . . . . . . . . . . . . 8 90 B.3. Will existing UAs ignore the parameter? . . . . . . . . . 8 91 Appendix C. Change Log (to be removed by RFC Editor before 92 publication) . . . . . . . . . . . . . . . . . . . . 9 93 C.1. Since draft-reschke-basicauth-enc-00 . . . . . . . . . . . 9 94 C.2. Since draft-reschke-basicauth-enc-01 . . . . . . . . . . . 9 95 C.3. Since draft-reschke-basicauth-enc-02 . . . . . . . . . . . 9 96 C.4. Since draft-reschke-basicauth-enc-03 . . . . . . . . . . . 9 97 C.5. Since draft-reschke-basicauth-enc-04 . . . . . . . . . . . 9 98 C.6. Since draft-reschke-basicauth-enc-05 . . . . . . . . . . . 9 99 C.7. Since draft-reschke-basicauth-enc-06 . . . . . . . . . . . 9 100 C.8. Since draft-reschke-basicauth-enc-07 . . . . . . . . . . . 9 101 C.9. Since draft-reschke-basicauth-enc-08 . . . . . . . . . . . 9 102 C.10. Since draft-ietf-httpauth-basicauth-enc-00 . . . . . . . . 9 103 Appendix D. Resolved issues (to be removed by RFC Editor 104 before publication) . . . . . . . . . . . . . . . . . 10 105 D.1. terminology . . . . . . . . . . . . . . . . . . . . . . . 10 106 D.2. parmname2831 . . . . . . . . . . . . . . . . . . . . . . . 10 107 Appendix E. Open issues (to be removed by RFC Editor prior to 108 publication) . . . . . . . . . . . . . . . . . . . . 10 109 E.1. edit . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 110 E.2. unorm . . . . . . . . . . . . . . . . . . . . . . . . . . 10 112 1. Introduction 114 The "Basic" authentication scheme defined in Section 2 of [RFC2617] 115 does not properly define how to treat non-ASCII characters 116 ([USASCII]): it uses the Base64 ([RFC4648], Section 4) encoding of 117 the concatenation of username, separator character, and password 118 without stating which character encoding scheme to use. 120 This has led to a situation where user agent implementations 121 disagree, and servers make different assumptions based on the locales 122 they are running in. There is little interoperability for the non- 123 ASCII characters in the ISO-8859-1 character repertoire ([USASCII], 124 [ISO-8859-1]), and even less interoperability for any characters 125 beyond that. 127 This document defines a backwards-compatible extension to "Basic", 128 specifying the server's character encoding scheme expectation, using 129 a new auth-param for use in the Proxy-Authenticate and WWW- 130 Authenticate header fields, as defined in 131 [draft-ietf-httpbis-p7-auth]. 133 2. Notational Conventions 135 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 136 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 137 document are to be interpreted as described in [RFC2119]. 139 The terms (character) repertoire and character encoding scheme are 140 defined in Section 2 of [RFC6365]. 142 3. The 'charset' auth-param 144 In challenges, servers MAY use the "charset" authentication parameter 145 (case-insensitive) to indicate the character encoding scheme they 146 expect the user agent to use when generating "user-pass" (a sequence 147 of octets) from "userid" and "password" ([RFC2617], Section 2). 149 The only allowed value is "UTF-8", to be matched case-insensitively 150 (see [RFC2978], Section 2.3), indicating that the server expects the 151 UTF-8 character encoding scheme to be used ([RFC3629]). 153 Other values are reserved for future use. 155 Note: The 'charset' parameter cannot be included when sending 156 credentials (e.g. in the Authorization or Proxy-Authorization 157 header fields), as the "Basic" scheme uses a single token for 158 credentials ('token68' syntax), not a parameter list ('#auth- 159 param' syntax); see Section 2.1 of [draft-ietf-httpbis-p7-auth]. 161 Note: The name 'charset' has been chosen for consistency with 162 Section 2.1.1 of [RFC2831]. A better name would have been 163 'accept-charset', as it is not about the message it appears in, 164 but the server's expectation. 166 4. Example 168 In the example below, the server prompts for authentication in the 169 "foo" realm, using Basic authentication, with a preference for the 170 UTF-8 character encoding scheme: 172 WWW-Authenticate: Basic realm="foo", charset="UTF-8" 174 Note that the parameter value can be either a token or a quoted 175 string; in this case the server chose to use the quoted-string 176 notation. 178 The user's name is "test", and his password is the string "123" 179 followed by the Unicode character U+00A3 (POUND SIGN). Following 180 Section 1.2 of [RFC2617], but using the character encoding scheme 181 UTF-8, the user-pass, converted to a sequence of octets, is: 183 't' 'e' 's' 't' ':' '1' '2' '3' pound 184 74 65 73 74 3A 31 32 33 C2 A3 186 Encoding this octet sequence in Base64 ([RFC4648], Section 4) yields: 188 dGVzdDoxMjPCow== 190 Thus the Authorization header field would be: 192 Authorization: Basic dGVzdDoxMjPCow== 194 Or, for proxy authentication: 196 Proxy-Authorization: Basic dGVzdDoxMjPCow== 198 5. Security Considerations 200 This document does not introduce any new security considerations 201 beyond those defined for the "Basic" authentication scheme 202 ([RFC2617], Section 4), and those applicable to the handling of UTF-8 203 ([RFC3629], Section 10). 205 6. IANA Considerations 207 There are no IANA Considerations related to this specification. 209 7. Acknowledgements 211 The internationalisation problem has been reported as a Mozilla bug 212 back in the year 2000 (see 213 and also the 214 more recent ). 215 It was Andrew Clover's idea to address it using a new auth-param. 217 Thanks to Stephen Farrell, Bjoern Hoehrmann, Amos Jeffries, James 218 Manger, Yaron Sheffer, and Martin Thomson for providing feedback on 219 this document. 221 8. References 223 8.1. Normative References 225 [ISO-8859-1] International Organization for 226 Standardization, "Information 227 technology -- 8-bit single-byte coded 228 graphic character sets -- Part 1: Latin 229 alphabet No. 1", ISO/IEC 8859-1:1998, 230 1998. 232 [RFC2119] Bradner, S., "Key words for use in RFCs 233 to Indicate Requirement Levels", 234 BCP 14, RFC 2119, March 1997. 236 [RFC2617] Franks, J., Hallam-Baker, P., 237 Hostetler, J., Lawrence, S., Leach, P., 238 Luotonen, A., and L. Stewart, "HTTP 239 Authentication: Basic and Digest Access 240 Authentication", RFC 2617, June 1999. 242 [RFC2978] Freed, N. and J. Postel, "IANA Charset 243 Registration Procedures", BCP 19, 244 RFC 2978, October 2000. 246 [RFC3629] Yergeau, F., "UTF-8, a transformation 247 format of ISO 10646", STD 63, RFC 3629, 248 November 2003. 250 [RFC6365] Hoffman, P. and J. Klensin, 251 "Terminology Used in 252 Internationalization in the IETF", 253 BCP 166, RFC 6365, September 2011. 255 [USASCII] American National Standards Institute, 256 "Coded Character Set -- 7-bit American 257 Standard Code for Information 258 Interchange", ANSI X3.4, 1986. 260 [draft-ietf-httpbis-p7-auth] Fielding, R., Ed. and J. Reschke, Ed., 261 "Hypertext Transfer Protocol 262 (HTTP/1.1): Authentication", 263 draft-ietf-httpbis-p7-auth-22 (work in 264 progress), February 2013. 266 8.2. Informative References 268 [RFC2831] Leach, P. and C. Newman, "Using Digest 269 Authentication as a SASL Mechanism", 270 RFC 2831, May 2000. 272 [RFC4648] Josefsson, S., "The Base16, Base32, and 273 Base64 Data Encodings", RFC 4648, 274 October 2006. 276 [XHR] Aubourg, J., Song, J., and H. Steen, 277 "XMLHttpRequest", W3C Working Draft WD- 278 XMLHttpRequest-20121206, December 2012, 279 . 282 Latest version available at 283 . 285 Appendix A. Deployment Considerations 287 A.1. User Agents 289 User agents not implementing this specification should continue to 290 work as before, ignoring the new parameter. 292 User agents which already default to the UTF-8 encoding implement 293 this specification by definition. Note that some user agents also 294 have different defaults depending on whether the request originates 295 from page navigation as opposed to a script-driven request using 296 XMLHttpRequest [XHR]. 298 Other user agents can keep their default behavior, and switch to 299 UTF-8 when seeing the new parameter. 301 A.1.1. Alternative approach 303 On the other hand, the strategy below may already improve the user- 304 visible behavior today: 306 o In the first authentication request, choose the character encoding 307 scheme based on the user's credentials: if they do not need any 308 characters outside the ISO-8859-1 character repertoire, default to 309 ISO-8859-1, otherwise use UTF-8. 311 o If the first attempt failed and the encoding used was ISO-8859-1, 312 retry once with UTF-8 encoding instead. 314 Note that there's a risk if the site blocks an account after multiple 315 login failures (for instance, when it doesn't reset the counter after 316 a successful login). 318 A.2. Origin Servers 320 Origin servers that do not support non-ASCII characters in 321 credentials do not require any changes. 323 Origin servers that need to support non-ASCII characters, but can't 324 use the UTF-8 encoding will not be affected; they will continue to 325 function as well or as badly as before. 327 Finally, origin servers that need to support non-ASCII characters and 328 can use the UTF-8 encoding can opt in as described above. In the 329 worst case, they'll continue to see either broken credentials or no 330 credentials at all (depending on how legacy clients handle characters 331 they can not encode). 333 Appendix B. FAQ (to be removed by RFC Editor before publication) 335 B.1. Why not simply switch the default encoding to UTF-8? 337 There are sites in use today that default to a locale encoding, such 338 as ISO-8859-1, and expect user agents to use that encoding. These 339 sites will break if the user agent uses a different encoding, such as 340 UTF-8. 342 B.2. What about Digest? 344 The Digest scheme has similar issues with respect to 345 internationalization. The HTTPAuth Working Group is chartered to 346 address this problem as well, and the solution might be very similar. 348 B.3. Will existing UAs ignore the parameter? 350 It appears they will. See 351 and 352 . 354 Appendix C. Change Log (to be removed by RFC Editor before publication) 356 C.1. Since draft-reschke-basicauth-enc-00 358 Add and close issues "credparam" and "paramcase". Rewrite the 359 deployment considerations. 361 C.2. Since draft-reschke-basicauth-enc-01 363 Note more recent Mozilla bugzilla entry; add behavior of existing UAs 364 to FAQ (with pointer to test cases). 366 C.3. Since draft-reschke-basicauth-enc-02 368 Add and resolve issue "xhrutf8". 370 C.4. Since draft-reschke-basicauth-enc-03 372 Add and resolve issue "proxy". 374 C.5. Since draft-reschke-basicauth-enc-04 376 Add and resolve issues "paramname" and "sentparam". Add issues 377 "terminology" and "unorm". Update HTTPbis reference. 379 C.6. Since draft-reschke-basicauth-enc-05 381 Update HTTPbis reference. 383 C.7. Since draft-reschke-basicauth-enc-06 385 Update HTTPbis and XHR references. 387 C.8. Since draft-reschke-basicauth-enc-07 389 "b64token" -> "token68" (ABNF term changed in HTTPbis P7). Change 390 contact information from HTTPbis WG to HTTPAUTH WG. Add issue 391 parmname2831. Changed intended status to "experimental". 393 C.9. Since draft-reschke-basicauth-enc-08 395 Made it a draft of the IETF HTTPauth Working Group. 397 C.10. Since draft-ietf-httpauth-basicauth-enc-00 399 Clarify what encoding step the charset selection applies to. 401 Use RFC 6365 terminology. 403 Rename the parameter to "charset" for consistency with RFC 2831. 405 Appendix D. Resolved issues (to be removed by RFC Editor before 406 publication) 408 Issues that were either rejected or resolved in this version of this 409 document. 411 D.1. terminology 413 Type: edit 415 julian.reschke@greenbytes.de (2012-02-02): Try to be consistent with 416 the terminology defined in RFC 6365. 418 Resolution: Use "character repertoire" and "character encoding 419 scheme", refer to RFC 6365. 421 D.2. parmname2831 423 In Section 3: 425 Type: change 427 julian.reschke@greenbytes.de (2012-05-08): RFC 2831 (Digest SASL 428 Mechanism) defines a *very* similar parameter but calls it "charset". 429 We may want to be consistent with that. 431 Resolution: Be consistent with RFC 2831 and use "charset". 433 Appendix E. Open issues (to be removed by RFC Editor prior to 434 publication) 436 E.1. edit 438 Type: edit 440 julian.reschke@greenbytes.de (2010-08-11): Umbrella issue for 441 editorial fixes/enhancements. 443 E.2. unorm 445 Type: edit 447 julian.reschke@greenbytes.de (2012-02-02): We need a statement about 448 unicode normalization forms. 450 Author's Address 452 Julian F. Reschke 453 greenbytes GmbH 454 Hafenweg 16 455 Muenster, NW 48155 456 Germany 458 EMail: julian.reschke@greenbytes.de 459 URI: http://greenbytes.de/tech/webdav/