source: draft-ietf-httpbis/latest/p7-auth.xml @ 1672

Last change on this file since 1672 was 1672, checked in by julian.reschke@…, 8 years ago

add security consideration wrt realms (see #348)

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 48.9 KB
[29]1<?xml version="1.0" encoding="utf-8"?>
[101]2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
[8]3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns=''>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns=''>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns=''>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns=''>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns=''>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns=''>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns=''>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns=''>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns=''>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns=''>SHOULD NOT</bcp14>">
[29]14  <!ENTITY ID-VERSION "latest">
[1667]15  <!ENTITY ID-MONTH "June">
[1497]16  <!ENTITY ID-YEAR "2012">
[1101]17  <!ENTITY mdash "&#8212;">
[1452]18  <!ENTITY architecture                 "<xref target='Part1' x:rel='#architecture' xmlns:x=''/>">
[424]19  <!ENTITY notation                     "<xref target='Part1' x:rel='#notation' xmlns:x=''/>">
[1518]20  <!ENTITY abnf-extension               "<xref target='Part1' x:rel='#abnf.extension' xmlns:x=''/>">
[1399]21  <!ENTITY acks                         "<xref target='Part1' x:rel='#acks' xmlns:x=''/>">
[1518]22  <!ENTITY whitespace                   "<xref target='Part1' x:rel='#whitespace' xmlns:x=''/>">
23  <!ENTITY field-components             "<xref target='Part1' x:rel='#field.components' xmlns:x=''/>">
[961]24  <!ENTITY effective-request-uri        "<xref target='Part1' x:rel='#effective.request.uri' xmlns:x=''/>">
[1518]25  <!ENTITY msg-orient-and-buffering     "<xref target='Part1' x:rel='#intermediaries' xmlns:x=''/>">
[998]26  <!ENTITY end-to-end.and-hop-by-hop    "<xref target='Part1' x:rel='#end-to-end.and.hop-by-hop.header-fields' xmlns:x=''/>">
[31]27  <!ENTITY shared-and-non-shared-caches "<xref target='Part6' x:rel='#shared.and.non-shared.caches' xmlns:x=''/>">
29<?rfc toc="yes" ?>
[29]30<?rfc symrefs="yes" ?>
31<?rfc sortrefs="yes" ?>
[8]32<?rfc compact="yes"?>
33<?rfc subcompact="no" ?>
34<?rfc linkmailto="no" ?>
35<?rfc editing="no" ?>
[205]36<?rfc comments="yes"?>
37<?rfc inline="yes"?>
[799]38<?rfc rfcedstyle="yes"?>
[8]39<?rfc-ext allow-markup-in-artwork="yes" ?>
40<?rfc-ext include-references-in-index="yes" ?>
[1477]41<rfc obsoletes="2616" updates="2617" category="std" x:maturity-level="proposed"
[446]42     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p7-auth-&ID-VERSION;"
[153]43     xmlns:x=''>
[1472]44<x:link rel="prev" basename="p6-cache"/>
[1522]45<x:feedback template="{docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
[120]48  <title abbrev="HTTP/1.1, Part 7">HTTP/1.1, part 7: Authentication</title>
[29]50  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
[1106]51    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[8]52    <address>
53      <postal>
[1106]54        <street>345 Park Ave</street>
55        <city>San Jose</city>
[8]56        <region>CA</region>
[1106]57        <code>95110</code>
[29]58        <country>USA</country>
[8]59      </postal>
[29]60      <email></email>
61      <uri></uri>
[8]62    </address>
63  </author>
[95]65  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
66    <organization abbrev="W3C">World Wide Web Consortium</organization>
67    <address>
68      <postal>
69        <street>W3C / ERCIM</street>
70        <street>2004, rte des Lucioles</street>
71        <city>Sophia-Antipolis</city>
72        <region>AM</region>
73        <code>06902</code>
74        <country>France</country>
75      </postal>
76      <email></email>
77      <uri></uri>
78    </address>
79  </author>
81  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
82    <organization abbrev="greenbytes">greenbytes GmbH</organization>
83    <address>
84      <postal>
85        <street>Hafenweg 16</street>
86        <city>Muenster</city><region>NW</region><code>48155</code>
87        <country>Germany</country>
88      </postal>
[609]89      <phone>+49 251 2807760</phone>
90      <facsimile>+49 251 2807761</facsimile>
91      <email></email>
92      <uri></uri>
[95]93    </address>
94  </author>
[31]96  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
[440]97  <workgroup>HTTPbis Working Group</workgroup>
[1373]101   The Hypertext Transfer Protocol (HTTP) is an application-level protocol for
102   distributed, collaborative, hypermedia information systems. HTTP has been in
103   use by the World Wide Web global information initiative since 1990. This
104   document is Part 7 of the seven-part specification that defines the protocol
105   referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616.
108   Part 7 defines the HTTP Authentication framework.
112<note title="Editorial Note (To be removed by RFC Editor)">
113  <t>
114    Discussion of this draft should take place on the HTTPBIS working group
[1268]115    mailing list (, which is archived at
116    <eref target=""/>.
117  </t>
118  <t>
119    The current issues list is at
120    <eref target=""/> and related
121    documents (including fancy diffs) can be found at
[324]122    <eref target=""/>.
[36]123  </t>
[153]124  <t>
[1592]125    The changes in this draft are summarized in <xref target="changes.since.19"/>.
[153]126  </t>
130<section title="Introduction" anchor="introduction">
[998]132   This document defines HTTP/1.1 access control and authentication. It
133   includes the relevant parts of <xref target="RFC2616" x:fmt="none">RFC 2616</xref>
[1636]134   with only minor changes (<xref target="RFC2616"/>), plus the general framework for HTTP authentication,
[998]135   as previously defined in "HTTP Authentication: Basic and Digest Access
136   Authentication" (<xref target="RFC2617"/>).
139   HTTP provides several &OPTIONAL; challenge-response authentication
[998]140   mechanisms which can be used by a server to challenge a client request and
141   by a client to provide authentication information. The "basic" and "digest"
142   authentication schemes continue to be specified in
143   <xref target="RFC2617" x:fmt="none">RFC 2617</xref>.
[1452]146<section title="Conformance and Error Handling" anchor="intro.conformance.and.error.handling">
148   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
149   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
150   document are to be interpreted as described in <xref target="RFC2119"/>.
[1452]153   This document defines conformance criteria for several roles in HTTP
154   communication, including Senders, Recipients, Clients, Servers, User-Agents,
155   Origin Servers, Intermediaries, Proxies and Gateways. See &architecture;
156   for definitions of these terms.
159   An implementation is considered conformant if it complies with all of the
160   requirements associated with its role(s). Note that SHOULD-level requirements
161   are relevant here, unless one of the documented exceptions is applicable.
164   This document also uses ABNF to define valid protocol elements
165   (<xref target="notation"/>). In addition to the prose requirements placed
166   upon them, Senders &MUST-NOT; generate protocol elements that are invalid.
169   Unless noted otherwise, Recipients &MAY; take steps to recover a usable
170   protocol element from an invalid construct. However, HTTP does not define
171   specific error handling mechanisms, except in cases where it has direct
172   impact on security. This is because different uses of the protocol require
173   different error handling strategies; for example, a Web browser may wish to
174   transparently recover from a response where the Location header field
175   doesn't parse according to the ABNF, whereby in a systems control protocol
176   using HTTP, this type of error recovery could lead to dangerous consequences.
[424]180<section title="Syntax Notation" anchor="notation">
[425]181  <x:anchor-alias value="ALPHA"/>
182  <x:anchor-alias value="CR"/>
183  <x:anchor-alias value="DIGIT"/>
184  <x:anchor-alias value="LF"/>
185  <x:anchor-alias value="OCTET"/>
186  <x:anchor-alias value="VCHAR"/>
[998]187  <x:anchor-alias value="SP"/>
[1518]189   This specification uses the Augmented Backus-Naur Form (ABNF) notation
190   of <xref target="RFC5234"/> with the list rule extension defined in
191   &notation;.  <xref target="collected.abnf"/> shows the collected ABNF
192   with the list rule expanded.
[425]195  The following core rules are included by
196  reference, as defined in <xref target="RFC5234" x:fmt="," x:sec="B.1"/>:
197  ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
198  DIGIT (decimal 0-9), DQUOTE (double quote),
199  HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed),
[1425]200  OCTET (any 8-bit sequence of data), SP (space), and
201  VCHAR (any visible US-ASCII character).
204<section title="Core Rules" anchor="core.rules">
[998]205   <x:anchor-alias value="quoted-string"/>
206   <x:anchor-alias value="token"/>
[1386]207   <x:anchor-alias value="BWS"/>
[998]208   <x:anchor-alias value="OWS"/>
[1396]210   The core rules below are defined in <xref target="Part1"/>:
212<figure><artwork type="abnf2616">
[1518]213  <x:ref>BWS</x:ref>           = &lt;BWS, defined in &whitespace;&gt;
214  <x:ref>OWS</x:ref>           = &lt;OWS, defined in &whitespace;&gt;
215  <x:ref>quoted-string</x:ref> = &lt;quoted-string, defined in &field-components;&gt;
216  <x:ref>token</x:ref>         = &lt;token, defined in &field-components;&gt;
[998]222<section title="Access Authentication Framework" anchor="access.authentication.framework">
224<section title="Challenge and Response" anchor="challenge.and.response">
[998]225  <x:anchor-alias value="auth-scheme"/>
226  <x:anchor-alias value="auth-param"/>
[1394]227  <x:anchor-alias value="b64token"/>
[229]228  <x:anchor-alias value="challenge"/>
229  <x:anchor-alias value="credentials"/>
[998]231   HTTP provides a simple challenge-response authentication mechanism
232   that can be used by a server to challenge a client request and by a
233   client to provide authentication information. It uses an extensible,
[1394]234   case-insensitive token to identify the authentication scheme, followed
235   by additional information necessary for achieving authentication via that
[1473]236   scheme. The latter can either be a comma-separated list of parameters or a
237   single sequence of characters capable of holding base64-encoded
[1394]238   information.
241   Parameters are name-value pairs where the name is matched case-insensitively,
242   and each parameter name &MUST; only occur once per challenge.
[1394]244<figure><artwork type="abnf2616"><iref item="auth-scheme" primary="true"/><iref item="auth-param" primary="true"/><iref primary="true" item="Grammar" subitem="auth-scheme"/><iref primary="true" item="Grammar" subitem="auth-param"/><iref item="b64token" primary="true"/><iref primary="true" item="Grammar" subitem="b64token"/>
[1386]245  auth-scheme    = <x:ref>token</x:ref>
[1386]247  auth-param     = <x:ref>token</x:ref> <x:ref>BWS</x:ref> "=" <x:ref>BWS</x:ref> ( <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref> )
249  b64token       = 1*( <x:ref>ALPHA</x:ref> / <x:ref>DIGIT</x:ref> /
250                       "-" / "." / "_" / "~" / "+" / "/" ) *"="
[1394]253   The "b64token" syntax allows the 66 unreserved URI characters (<xref target="RFC3986"/>),
254   plus a few others, so that it can hold a base64, base64url (URL and filename
255   safe alphabet), base32, or base16 (hex) encoding, with or without padding, but
256   excluding whitespace (<xref target="RFC4648"/>).
[998]259   The 401 (Unauthorized) response message is used by an origin server
260   to challenge the authorization of a user agent. This response &MUST;
261   include a WWW-Authenticate header field containing at least one
[1344]262   challenge applicable to the requested resource.
265   The 407 (Proxy Authentication Required) response message is used by a proxy to
[998]266   challenge the authorization of a client and &MUST; include a Proxy-Authenticate
267   header field containing at least one challenge
268   applicable to the proxy for the requested resource.
[1387]270<figure><artwork type="abnf2616"><iref item="challenge" primary="true"/><iref primary="true" item="Grammar" subitem="challenge"/>
[1394]271  <x:ref>challenge</x:ref>   = <x:ref>auth-scheme</x:ref> [ 1*<x:ref>SP</x:ref> ( <x:ref>b64token</x:ref> / #<x:ref>auth-param</x:ref> ) ]
274  <t>
[1343]275     <x:h>Note:</x:h> User agents will need to take special care in parsing the
276     WWW-Authenticate and Proxy-Authenticate header field values because they
277     can contain more than one challenge, or if more than one of each is
278     provided, since the contents of a challenge can itself contain a
279     comma-separated list of authentication parameters.
[998]280  </t>
283  <t>
[1600]284     <x:h>Note:</x:h> Many clients fail to parse challenges containing unknown
[1343]285     schemes. A workaround for this problem is to list well-supported schemes
[1344]286     (such as "basic") first.<!-- see -->
[1018]287  </t>
[1344]290   A user agent that wishes to authenticate itself with an origin server
291   &mdash; usually, but not necessarily, after receiving a 401 (Unauthorized)
[1665]292   &mdash; can do so by including an Authorization header field with the
[1344]293   request.
296   A client that wishes to authenticate itself with a proxy &mdash; usually,
297   but not necessarily, after receiving a 407 (Proxy Authentication Required)
[1665]298   &mdash; can do so by including a Proxy-Authorization header field with the
[1344]299   request.
[1344]302   Both the Authorization field value and the Proxy-Authorization field value
[1669]303   contain the client's credentials for the realm of the resource being
304   requested, based upon a challenge received from the server (possibly at
305   some point in the past). When creating their values, the user agent ought to
306   do so by selecting the challenge with what it considers to be the most
307   secure auth-scheme that it understands, obtaining credentials from the user
308   as appropriate.
[1387]310<figure><artwork type="abnf2616"><iref item="credentials" primary="true"/><iref primary="true" item="Grammar" subitem="credentials"/>
[1394]311  <x:ref>credentials</x:ref> = <x:ref>auth-scheme</x:ref> [ 1*<x:ref>SP</x:ref> ( <x:ref>b64token</x:ref> / #<x:ref>auth-param</x:ref> ) ]
314   If the origin server does not wish to accept the credentials sent
315   with a request, it &SHOULD; return a 401 (Unauthorized) response. The
316   response &MUST; include a WWW-Authenticate header field containing at
317   least one (possibly new) challenge applicable to the requested
[1344]318   resource.
321   If a proxy does not accept the credentials sent with a
[998]322   request, it &SHOULD; return a 407 (Proxy Authentication Required). The
323   response &MUST; include a Proxy-Authenticate header field containing a
324   (possibly new) challenge applicable to the proxy for the requested
325   resource.
328   The HTTP protocol does not restrict applications to this simple
329   challenge-response mechanism for access authentication. Additional
330   mechanisms &MAY; be used, such as encryption at the transport level or
331   via message encapsulation, and with additional header fields
[1107]332   specifying authentication information. However, such additional
[998]333   mechanisms are not defined by this specification.
[1107]336   Proxies &MUST; forward the WWW-Authenticate and Authorization headers
337   unmodified and follow the rules found in <xref target="header.authorization"/>.
[1344]341<section title="Protection Space (Realm)" anchor="">
[1354]342  <iref item="Protection Space"/>
343  <iref item="Realm"/>
[1672]344  <iref item="Canonical Root URI"/>
[1354]346   The authentication parameter realm is reserved for use by authentication
[1478]347   schemes that wish to indicate the scope of protection.
[1354]350   A <x:dfn>protection space</x:dfn> is defined by the canonical root URI (the
351   scheme and authority components of the effective request URI; see
352   <xref target="Part1" x:fmt="of" x:rel="#effective.request.uri"/>) of the
353   server being accessed, in combination with the realm value if present.
[1344]354   These realms allow the protected resources on a server to be
355   partitioned into a set of protection spaces, each with its own
356   authentication scheme and/or authorization database. The realm value
357   is a string, generally assigned by the origin server, which can have
358   additional semantics specific to the authentication scheme. Note that
359   there can be multiple challenges with the same auth-scheme but
360   different realms.
363   The protection space determines the domain over which credentials can
364   be automatically applied. If a prior request has been authorized, the
365   same credentials &MAY; be reused for all other requests within that
366   protection space for a period of time determined by the
367   authentication scheme, parameters, and/or user preference. Unless
368   otherwise defined by the authentication scheme, a single protection
369   space cannot extend outside the scope of its server.
372   For historical reasons, senders &MUST; only use the quoted-string syntax.
373   Recipients might have to support both token and quoted-string syntax for
374   maximum interoperability with existing clients that have been accepting both
375   notations for a long time.
[1026]379<section title="Authentication Scheme Registry" anchor="authentication.scheme.registry">
381  The HTTP Authentication Scheme Registry defines the name space for the
382  authentication schemes in challenges and credentials.
385  Registrations &MUST; include the following fields:
386  <list style="symbols">
387    <t>Authentication Scheme Name</t>
388    <t>Pointer to specification text</t>
[1371]389    <t>Notes (optional)</t>
[1026]390  </list>
[1567]393  Values to be added to this name space require IETF Review
394  (see <xref target="RFC5226" x:fmt="," x:sec="4.1"/>).
397  The registry itself is maintained at <eref target=""/>.
400<section title="Considerations for New Authentication Schemes" anchor="">
402  There are certain aspects of the HTTP Authentication Framework that put
403  constraints on how new authentication schemes can work:
406  <list style="symbols">
[1360]407    <x:lt>
[1356]408    <t>
[1518]409      HTTP authentication is presumed to be stateless: all of the information
410      necessary to authenticate a request &MUST; be provided in the request,
411      rather than be dependent on the server remembering prior requests.
412      Authentication based on, or bound to, the underlying connection is
413      outside the scope of this specification and inherently flawed unless
414      steps are taken to ensure that the connection cannot be used by any
415      party other than the authenticated user
416      (see &msg-orient-and-buffering;).
[1356]417    </t>
[1360]418    </x:lt>
419    <x:lt>
[1356]420    <t>
421      The authentication parameter "realm" is reserved for defining Protection
422      Spaces as defined in <xref target=""/>. New schemes
423      &MUST-NOT; use it in a way incompatible with that definition.
424    </t>
[1360]425    </x:lt>
426    <x:lt>
[1356]427    <t>
[1394]428      The "b64token" notation was introduced for compatibility with existing
429      authentication schemes and can only be used once per challenge/credentials.
430      New schemes thus ought to use the "auth-param" syntax instead, because
431      otherwise future extensions will be impossible.
432    </t>
433    </x:lt>
434    <x:lt>
435    <t>
[1465]436      The parsing of challenges and credentials is defined by this specification,
437      and cannot be modified by new authentication schemes. When the auth-param
438      syntax is used, all parameters ought to support both token and
439      quoted-string syntax, and syntactical constraints ought to be defined on
440      the field value after parsing (i.e., quoted-string processing). This is
441      necessary so that recipients can use a generic parser that applies to
442      all authentication schemes.
443    </t>
444    <t>
445      <x:h>Note:</x:h> the fact that the value syntax for the "realm" parameter
446      is restricted to quoted-string was a bad design choice not to be repeated
447      for new parameters.
448    </t>
449    </x:lt>
450    <x:lt>
451    <t>
[1562]452      Definitions of new schemes ought to define the treatment of unknown
453      extension parameters. In general, a "must-ignore" rule is preferable
454      over "must-understand", because otherwise it will be hard to introduce
455      new parameters in the presence of legacy recipients. Furthermore,
456      it's good to describe the policy for defining new parameters (such
457      as "update the specification", or "use this registry").
458    </t>
459    </x:lt>
460    <x:lt>
461    <t>
[1357]462      Authentication schemes need to document whether they are usable in
[1356]463      origin-server authentication (i.e., using WWW-Authenticate), and/or
464      proxy authentication (i.e., using Proxy-Authenticate).
[1360]465    </t>
466    </x:lt>
467    <x:lt>
468    <t>
469      The credentials carried in an Authorization header field are specific to
470      the User Agent, and therefore have the same effect on HTTP caches as the
471      "private" Cache-Control response directive, within the scope of the
472      request they appear in.
473    </t>
474    <t>
475      Therefore, new authentication schemes which choose not to carry
476      credentials in the Authorization header (e.g., using a newly defined
477      header) will need to explicitly disallow caching, by mandating the use of
478      either Cache-Control request directives (e.g., "no-store") or response
479      directives (e.g., "private").
480    </t>
481    </x:lt>
[1356]482  </list>
[838]490<section title="Status Code Definitions" anchor="status.code.definitions">
[39]491<section title="401 Unauthorized" anchor="status.401">
492  <iref primary="true" item="401 Unauthorized (status code)" x:for-anchor=""/>
493  <iref primary="true" item="Status Codes" subitem="401 Unauthorized" x:for-anchor=""/>
495   The request requires user authentication. The response &MUST; include a
496   WWW-Authenticate header field (<xref target="header.www-authenticate"/>) containing a challenge
[965]497   applicable to the target resource. The client &MAY; repeat the
[39]498   request with a suitable Authorization header field (<xref target="header.authorization"/>). If
499   the request already included Authorization credentials, then the 401
500   response indicates that authorization has been refused for those
501   credentials. If the 401 response contains the same challenge as the
502   prior response, and the user agent has already attempted
503   authentication at least once, then the user &SHOULD; be presented the
[874]504   representation that was given in the response, since that representation might
[998]505   include relevant diagnostic information.
508<section title="407 Proxy Authentication Required" anchor="status.407">
509  <iref primary="true" item="407 Proxy Authentication Required (status code)" x:for-anchor=""/>
510  <iref primary="true" item="Status Codes" subitem="407 Proxy Authentication Required" x:for-anchor=""/>
512   This code is similar to 401 (Unauthorized), but indicates that the
[998]513   client ought to first authenticate itself with the proxy. The proxy &MUST;
[39]514   return a Proxy-Authenticate header field (<xref target="header.proxy-authenticate"/>) containing a
[965]515   challenge applicable to the proxy for the target resource. The
[39]516   client &MAY; repeat the request with a suitable Proxy-Authorization
[998]517   header field (<xref target="header.proxy-authorization"/>).
[1415]522<section title="Header Field Definitions" anchor="header.field.definitions">
[117]524   This section defines the syntax and semantics of HTTP/1.1 header fields
525   related to authentication.
528<section title="Authorization" anchor="header.authorization">
[1120]529  <iref primary="true" item="Authorization header field" x:for-anchor=""/>
530  <iref primary="true" item="Header Fields" subitem="Authorization" x:for-anchor=""/>
[229]531  <x:anchor-alias value="Authorization"/>
[1163]533   The "Authorization" header field allows a user agent to authenticate
[1101]534   itself with a server &mdash; usually, but not necessarily, after receiving a 401
[698]535   (Unauthorized) response. Its value consists of credentials containing
536   information of the user agent for the realm of the resource being
537   requested.
[1230]539<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Authorization"/>
540  <x:ref>Authorization</x:ref> = <x:ref>credentials</x:ref>
[998]543   If a request is
[698]544   authenticated and a realm specified, the same credentials &SHOULD;
545   be valid for all other requests within this realm (assuming that
546   the authentication scheme itself does not require otherwise, such
547   as credentials that vary according to a challenge value or using
548   synchronized clocks).
[29]551      When a shared cache (see &shared-and-non-shared-caches;) receives a request
[8]552      containing an Authorization field, it &MUST-NOT; return the
553      corresponding response as a reply to any other request, unless one
554      of the following specific exceptions holds:
557  <list style="numbers">
558      <t>If the response includes the "s-maxage" cache-control
559         directive, the cache &MAY; use that response in replying to a
560         subsequent request. But (if the specified maximum age has
561         passed) a proxy cache &MUST; first revalidate it with the origin
[1163]562         server, using the header fields from the new request to allow
[8]563         the origin server to authenticate the new request. (This is the
564         defined behavior for s-maxage.) If the response includes "s-maxage=0",
565         the proxy &MUST; always revalidate it before re-using
566         it.</t>
568      <t>If the response includes the "must-revalidate" cache-control
569         directive, the cache &MAY; use that response in replying to a
570         subsequent request. But if the response is stale, all caches
571         &MUST; first revalidate it with the origin server, using the
[1163]572         header fields from the new request to allow the origin server
[8]573         to authenticate the new request.</t>
575      <t>If the response includes the "public" cache-control directive,
576         it &MAY; be returned in reply to any subsequent request.</t>
577  </list>
581<section title="Proxy-Authenticate" anchor="header.proxy-authenticate">
[1120]582  <iref primary="true" item="Proxy-Authenticate header field" x:for-anchor=""/>
583  <iref primary="true" item="Header Fields" subitem="Proxy-Authenticate" x:for-anchor=""/>
[229]584  <x:anchor-alias value="Proxy-Authenticate"/>
[1601]586   The "Proxy-Authenticate" header field consists of at least one
587   challenge that indicates the authentication scheme(s) and parameters
588   applicable to the proxy for this effective request URI (&effective-request-uri;).
589   It &MUST; be included as part of a 407 (Proxy Authentication Required) response.
[1230]591<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Proxy-Authenticate"/>
592  <x:ref>Proxy-Authenticate</x:ref> = 1#<x:ref>challenge</x:ref>
[998]595   Unlike WWW-Authenticate, the Proxy-Authenticate header field applies only to
[8]596   the current connection and &SHOULD-NOT;  be passed on to downstream
597   clients. However, an intermediate proxy might need to obtain its own
598   credentials by requesting them from the downstream client, which in
599   some circumstances will appear as if the proxy is forwarding the
600   Proxy-Authenticate header field.
603   Note that the parsing considerations for WWW-Authenticate apply to this
604   header field as well; see <xref target="header.www-authenticate"/> for
605   details.
609<section title="Proxy-Authorization" anchor="header.proxy-authorization">
[1120]610  <iref primary="true" item="Proxy-Authorization header field" x:for-anchor=""/>
611  <iref primary="true" item="Header Fields" subitem="Proxy-Authorization" x:for-anchor=""/>
[229]612  <x:anchor-alias value="Proxy-Authorization"/>
[1163]614   The "Proxy-Authorization" header field allows the client to
[8]615   identify itself (or its user) to a proxy which requires
[698]616   authentication. Its value consists of
[8]617   credentials containing the authentication information of the user
618   agent for the proxy and/or realm of the resource being requested.
[1230]620<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Proxy-Authorization"/>
621  <x:ref>Proxy-Authorization</x:ref> = <x:ref>credentials</x:ref>
[998]624   Unlike Authorization, the Proxy-Authorization header field applies only to
[8]625   the next outbound proxy that demanded authentication using the Proxy-Authenticate
626   field. When multiple proxies are used in a chain, the
627   Proxy-Authorization header field is consumed by the first outbound
628   proxy that was expecting to receive credentials. A proxy &MAY; relay
629   the credentials from the client request to the next proxy if that is
630   the mechanism by which the proxies cooperatively authenticate a given
631   request.
635<section title="WWW-Authenticate" anchor="header.www-authenticate">
[1120]636  <iref primary="true" item="WWW-Authenticate header field" x:for-anchor=""/>
637  <iref primary="true" item="Header Fields" subitem="WWW-Authenticate" x:for-anchor=""/>
[229]638  <x:anchor-alias value="WWW-Authenticate"/>
[1163]640   The "WWW-Authenticate" header field consists of at least one
[698]641   challenge that indicates the authentication scheme(s) and parameters
[1360]642   applicable to the effective request URI (&effective-request-uri;).
645   It &MUST; be included in 401 (Unauthorized) response messages and &MAY; be
646   included in other response messages to indicate that supplying credentials
647   (or different credentials) might affect the response.
[1230]649<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="WWW-Authenticate"/>
650  <x:ref>WWW-Authenticate</x:ref> = 1#<x:ref>challenge</x:ref>
[998]653   User agents are advised to take special care in parsing the WWW-Authenticate
[8]654   field value as it might contain more than one challenge,
655   or if more than one WWW-Authenticate header field is provided, the
656   contents of a challenge itself can contain a comma-separated list of
657   authentication parameters.
660  <preamble>For instance:</preamble>
661  <artwork type="example">
662  WWW-Authenticate: Newauth realm="apps", type=1,
663                    title="Login to \"apps\"", Basic realm="simple"
665  <postamble>
666  This header field contains two challenges; one for the "Newauth" scheme
667  with a realm value of "apps", and two additional parameters "type" and
[1533]668  "title", and another one for the "Basic" scheme with a realm value of
669  "simple".
672  <t>
673    <x:h>Note:</x:h> The challenge grammar production uses the list syntax as
674    well. Therefore, a sequence of comma, whitespace, and comma can be
675    considered both as applying to the preceding challenge, or to be an
676    empty entry in the list of challenges. In practice, this ambiguity
677    does not affect the semantics of the header field value and thus is
678    harmless.
679  </t>
[29]685<section title="IANA Considerations" anchor="IANA.considerations">
[1026]687<section title="Authenticaton Scheme Registry" anchor="authentication.scheme.registration">
689  The registration procedure for HTTP Authentication Schemes is defined by
690  <xref target="authentication.scheme.registry"/> of this document.
693   The HTTP Method Authentication Scheme shall be created at <eref target=""/>.
[700]697<section title="Status Code Registration" anchor="status.code.registration">
699   The HTTP Status Code Registry located at <eref target=""/>
[969]700   shall be updated with the registrations below:
702<?BEGININC p7-auth.iana-status-codes ?>
703<!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually-->
704<texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
705   <ttcol>Value</ttcol>
706   <ttcol>Description</ttcol>
707   <ttcol>Reference</ttcol>
708   <c>401</c>
709   <c>Unauthorized</c>
710   <c>
711      <xref target="status.401"/>
712   </c>
713   <c>407</c>
714   <c>Proxy Authentication Required</c>
715   <c>
716      <xref target="status.407"/>
717   </c>
720<?ENDINC p7-auth.iana-status-codes ?>
[921]723<section title="Header Field Registration" anchor="header.field.registration">
[969]725   The Message Header Field Registry located at <eref target=""/> shall be updated
[290]726   with the permanent registrations below (see <xref target="RFC3864"/>):
[680]728<?BEGININC p7-auth.iana-headers ?>
[253]729<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
[290]730<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
[253]731   <ttcol>Header Field Name</ttcol>
732   <ttcol>Protocol</ttcol>
733   <ttcol>Status</ttcol>
734   <ttcol>Reference</ttcol>
736   <c>Authorization</c>
737   <c>http</c>
738   <c>standard</c>
739   <c>
740      <xref target="header.authorization"/>
741   </c>
742   <c>Proxy-Authenticate</c>
743   <c>http</c>
744   <c>standard</c>
745   <c>
746      <xref target="header.proxy-authenticate"/>
747   </c>
748   <c>Proxy-Authorization</c>
749   <c>http</c>
750   <c>standard</c>
751   <c>
752      <xref target="header.proxy-authorization"/>
753   </c>
754   <c>WWW-Authenticate</c>
755   <c>http</c>
756   <c>standard</c>
757   <c>
758      <xref target="header.www-authenticate"/>
759   </c>
[680]762<?ENDINC p7-auth.iana-headers ?>
[290]764   The change controller is: "IETF ( - Internet Engineering Task Force".
769<section title="Security Considerations" anchor="security.considerations">
771   This section is meant to inform application developers, information
772   providers, and users of the security limitations in HTTP/1.1 as
773   described by this document. The discussion does not include
774   definitive solutions to the problems revealed, though it does make
775   some suggestions for reducing security risks.
778<section title="Authentication Credentials and Idle Clients" anchor="auth.credentials.and.idle.clients">
780   Existing HTTP clients and user agents typically retain authentication
[145]781   information indefinitely. HTTP/1.1 does not provide a method for a
[8]782   server to direct clients to discard these cached credentials. This is
783   a significant defect that requires further extensions to HTTP.
784   Circumstances under which credential caching can interfere with the
785   application's security model include but are not limited to:
786  <list style="symbols">
787     <t>Clients which have been idle for an extended period following
788        which the server might wish to cause the client to reprompt the
789        user for credentials.</t>
791     <t>Applications which include a session termination indication
[746]792        (such as a "logout" or "commit" button on a page) after which
793        the server side of the application "knows" that there is no
[8]794        further reason for the client to retain the credentials.</t>
795  </list>
798   This is currently under separate study. There are a number of work-arounds
799   to parts of this problem, and we encourage the use of
800   password protection in screen savers, idle time-outs, and other
801   methods which mitigate the security problems inherent in this
802   problem. In particular, user agents which cache credentials are
803   encouraged to provide a readily accessible mechanism for discarding
804   cached credentials under user control.
808<section title="Protection Spaces" anchor="protection.spaces">
810  Authentication schemes that solely rely on the "realm" mechanism for
811  establishing a protection space will expose credentials to all resources on a
812  server. Clients that have successfully made authenticated requests with a
813  resource can use the same authentication credentials for other resources on
814  the same server. This makes it possible for a different resource to harvest
815  authentication credentials for other resources.
818  This is of particular concern when a server hosts resources for multiple
819  parties under the same canonical root URI (<xref target="protection.spaces"/>).
820  Possible mitigation strategies include restricting direct access to
821  authentication credentials (i.e., not making the content of the
822  Authorization request header field available), and separating protection
823  spaces by using a different host name for each party.
[1364]828<section title="Acknowledgments" anchor="acks">
[998]830  This specification takes over the definition of the HTTP Authentication
[1363]831  Framework, previously defined in <xref target="RFC2617" x:fmt="none">RFC 2617</xref>.
832  We thank John Franks, Phillip M. Hallam-Baker, Jeffery L. Hostetler, Scott D. Lawrence,
[998]833  Paul J. Leach, Ari Luotonen, and Lawrence C. Stewart for their work
[1389]834  on that specification. See <xref target="RFC2617" x:fmt="of" x:sec="6"/>
[1363]835  for further acknowledgements. 
838  See &acks; for the Acknowledgments related to this document revision.
[119]845<references title="Normative References">
[205]847<reference anchor="Part1">
848  <front>
849    <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
850    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
[1106]851      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[205]852      <address><email></email></address>
853    </author>
854    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
855      <organization abbrev="W3C">World Wide Web Consortium</organization>
856      <address><email></email></address>
857    </author>
858    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
859      <organization abbrev="greenbytes">greenbytes GmbH</organization>
860      <address><email></email></address>
861    </author>
862    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
863  </front>
864  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
865  <x:source href="p1-messaging.xml" basename="p1-messaging"/>
[31]868<reference anchor="Part6">
[119]869  <front>
870    <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
871    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
[1106]872      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[119]873      <address><email></email></address>
874    </author>
875    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
876      <organization abbrev="W3C">World Wide Web Consortium</organization>
877      <address><email></email></address>
878    </author>
[601]879    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
[1440]880      <organization>Rackspace</organization>
[601]881      <address><email></email></address>
882    </author>
[119]883    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
884      <organization abbrev="greenbytes">greenbytes GmbH</organization>
885      <address><email></email></address>
886    </author>
887    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
888  </front>
889  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
890  <x:source href="p6-cache.xml" basename="p6-cache"/>
[96]893<reference anchor="RFC2119">
894  <front>
895    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
896    <author initials="S." surname="Bradner" fullname="Scott Bradner">
897      <organization>Harvard University</organization>
898      <address><email></email></address>
899    </author>
900    <date month="March" year="1997"/>
901  </front>
902  <seriesInfo name="BCP" value="14"/>
903  <seriesInfo name="RFC" value="2119"/>
[425]906<reference anchor="RFC5234">
907  <front>
908    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
909    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
910      <organization>Brandenburg InternetWorking</organization>
911      <address>
[728]912        <email></email>
913      </address> 
[425]914    </author>
915    <author initials="P." surname="Overell" fullname="Paul Overell">
916      <organization>THUS plc.</organization>
917      <address>
[728]918        <email></email>
919      </address>
[425]920    </author>
921    <date month="January" year="2008"/>
922  </front>
923  <seriesInfo name="STD" value="68"/>
924  <seriesInfo name="RFC" value="5234"/>
929<references title="Informative References">
931<reference anchor="RFC2616">
932  <front>
933    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
934    <author initials="R." surname="Fielding" fullname="R. Fielding">
935      <organization>University of California, Irvine</organization>
936      <address><email></email></address>
937    </author>
938    <author initials="J." surname="Gettys" fullname="J. Gettys">
939      <organization>W3C</organization>
940      <address><email></email></address>
941    </author>
942    <author initials="J." surname="Mogul" fullname="J. Mogul">
943      <organization>Compaq Computer Corporation</organization>
944      <address><email></email></address>
945    </author>
946    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
947      <organization>MIT Laboratory for Computer Science</organization>
948      <address><email></email></address>
949    </author>
950    <author initials="L." surname="Masinter" fullname="L. Masinter">
951      <organization>Xerox Corporation</organization>
952      <address><email></email></address>
953    </author>
954    <author initials="P." surname="Leach" fullname="P. Leach">
955      <organization>Microsoft Corporation</organization>
956      <address><email></email></address>
957    </author>
958    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
959      <organization>W3C</organization>
960      <address><email></email></address>
961    </author>
962    <date month="June" year="1999"/>
963  </front>
964  <seriesInfo name="RFC" value="2616"/>
[998]967<reference anchor="RFC2617">
968  <front>
969    <title abbrev="HTTP Authentication">HTTP Authentication: Basic and Digest Access Authentication</title>
970    <author initials="J." surname="Franks" fullname="John Franks">
971      <organization>Northwestern University, Department of Mathematics</organization>
972      <address><email></email></address>
973    </author>
974    <author initials="P.M." surname="Hallam-Baker" fullname="Phillip M. Hallam-Baker">
975      <organization>Verisign Inc.</organization>
976      <address><email></email></address>
977    </author>
978    <author initials="J.L." surname="Hostetler" fullname="Jeffery L. Hostetler">
979      <organization>AbiSource, Inc.</organization>
980      <address><email></email></address>
981    </author>
982    <author initials="S.D." surname="Lawrence" fullname="Scott D. Lawrence">
983      <organization>Agranat Systems, Inc.</organization>
984      <address><email></email></address>
985    </author>
986    <author initials="P.J." surname="Leach" fullname="Paul J. Leach">
987      <organization>Microsoft Corporation</organization>
988      <address><email></email></address>
989    </author>
990    <author initials="A." surname="Luotonen" fullname="Ari Luotonen">
991      <organization>Netscape Communications Corporation</organization>
992    </author>
993    <author initials="L." surname="Stewart" fullname="Lawrence C. Stewart">
994      <organization>Open Market, Inc.</organization>
995      <address><email></email></address>
996    </author>
997    <date month="June" year="1999"/>
998  </front>
999  <seriesInfo name="RFC" value="2617"/>
[253]1002<reference anchor='RFC3864'>
1003  <front>
1004    <title>Registration Procedures for Message Header Fields</title>
1005    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
1006      <organization>Nine by Nine</organization>
1007      <address><email></email></address>
1008    </author>
1009    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
1010      <organization>BEA Systems</organization>
1011      <address><email></email></address>
1012    </author>
1013    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
1014      <organization>HP Labs</organization>
1015      <address><email></email></address>
1016    </author>
1017    <date year='2004' month='September' />
1018  </front>
1019  <seriesInfo name='BCP' value='90' />
1020  <seriesInfo name='RFC' value='3864' />
[1394]1023<reference anchor="RFC3986">
1024 <front>
1025  <title abbrev='URI Generic Syntax'>Uniform Resource Identifier (URI): Generic Syntax</title>
1026  <author initials='T.' surname='Berners-Lee' fullname='Tim Berners-Lee'>
1027    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1028    <address>
1029       <email></email>
1030       <uri></uri>
1031    </address>
1032  </author>
1033  <author initials='R.' surname='Fielding' fullname='Roy T. Fielding'>
1034    <organization abbrev="Day Software">Day Software</organization>
1035    <address>
1036      <email></email>
1037      <uri></uri>
1038    </address>
1039  </author>
1040  <author initials='L.' surname='Masinter' fullname='Larry Masinter'>
1041    <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
1042    <address>
1043      <email></email>
1044      <uri></uri>
1045    </address>
1046  </author>
1047  <date month='January' year='2005'></date>
1048 </front>
1049 <seriesInfo name="STD" value="66"/>
1050 <seriesInfo name="RFC" value="3986"/>
1053<reference anchor="RFC4648">
1054  <front>
1055    <title>The Base16, Base32, and Base64 Data Encodings</title>
1056    <author fullname="S. Josefsson" initials="S." surname="Josefsson"/>
1057    <date year="2006" month="October"/>
1058  </front>
1059  <seriesInfo value="4648" name="RFC"/>
[1026]1062<reference anchor='RFC5226'>
1063  <front>
1064    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
1065    <author initials='T.' surname='Narten' fullname='T. Narten'>
1066      <organization>IBM</organization>
1067      <address><email></email></address>
1068    </author>
1069    <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'>
1070      <organization>Google</organization>
1071      <address><email></email></address>
1072    </author>
1073    <date year='2008' month='May' />
1074  </front>
1075  <seriesInfo name='BCP' value='26' />
1076  <seriesInfo name='RFC' value='5226' />
[1385]1081<section title="Changes from RFCs 2616 and 2617" anchor="changes.from.rfc.2616">
[1385]1083  The "realm" parameter isn't required anymore in general; consequently, the
1084  ABNF allows challenges without any auth parameters.
1085  (<xref target="access.authentication.framework"/>)
[1394]1088  The "b64token" alternative to auth-param lists has been added for consistency
1089  with legacy authentication schemes such as "Basic".
1090  (<xref target="access.authentication.framework"/>)
[1230]1093  Change ABNF productions for header fields to only define the field value.
[1415]1094  (<xref target="header.field.definitions"/>)
[680]1098<?BEGININC p7-auth.abnf-appendix ?>
[427]1099<section xmlns:x="" title="Collected ABNF" anchor="collected.abnf">
1101<artwork type="abnf" name="p7-auth.parsed-abnf">
[1230]1102<x:ref>Authorization</x:ref> = credentials
[1523]1104<x:ref>BWS</x:ref> = &lt;BWS, defined in [Part1], Section 3.2.1&gt;
[1523]1106<x:ref>OWS</x:ref> = &lt;OWS, defined in [Part1], Section 3.2.1&gt;
[1230]1108<x:ref>Proxy-Authenticate</x:ref> = *( "," OWS ) challenge *( OWS "," [ OWS
[425]1109 challenge ] )
[1230]1110<x:ref>Proxy-Authorization</x:ref> = credentials
[1230]1112<x:ref>WWW-Authenticate</x:ref> = *( "," OWS ) challenge *( OWS "," [ OWS challenge
1113 ] )
[1386]1115<x:ref>auth-param</x:ref> = token BWS "=" BWS ( token / quoted-string )
[998]1116<x:ref>auth-scheme</x:ref> = token
[1394]1118<x:ref>b64token</x:ref> = 1*( ALPHA / DIGIT / "-" / "." / "_" / "~" / "+" / "/" )
1119 *"="
[1394]1121<x:ref>challenge</x:ref> = auth-scheme [ 1*SP ( b64token / [ ( "," / auth-param ) *(
1122 OWS "," [ OWS auth-param ] ) ] ) ]
1123<x:ref>credentials</x:ref> = auth-scheme [ 1*SP ( b64token / [ ( "," / auth-param )
1124 *( OWS "," [ OWS auth-param ] ) ] ) ]
[1523]1126<x:ref>quoted-string</x:ref> = &lt;quoted-string, defined in [Part1], Section 3.2.4&gt;
[1523]1128<x:ref>token</x:ref> = &lt;token, defined in [Part1], Section 3.2.4&gt;
[532]1131<figure><preamble>ABNF diagnostics:</preamble><artwork type="inline">
1132; Authorization defined but not used
[425]1133; Proxy-Authenticate defined but not used
1134; Proxy-Authorization defined but not used
1135; WWW-Authenticate defined but not used
[680]1137<?ENDINC p7-auth.abnf-appendix ?>
[252]1139<section title="Change Log (to be removed by RFC Editor before publication)"  anchor="change.log">
[1624]1141  Changes up to the first Working Group Last Call draft are summarized
1142  in <eref target=""/>.
[1592]1145<section title="Since draft-ietf-httpbis-p7-auth-19" anchor="changes.since.19">
[1669]1147  Closed issues:
1148  <list style="symbols">
1149    <t>
[1672]1150      <eref target=""/>:
1151      "Realms and scope"
1152    </t>
1153    <t>
[1669]1154      <eref target=""/>:
1155      "Strength"
1156    </t>
1157  </list>
Note: See TracBrowser for help on using the repository browser.