source: draft-ietf-httpbis/25/p7-auth.xml @ 2719

Last change on this file since 2719 was 2495, checked in by julian.reschke@…, 7 years ago

prepare publication of -25 drafts on 2013-11-17

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 47.3 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>">
[2495]14  <!ENTITY ID-VERSION "25">
[2461]15  <!ENTITY ID-MONTH "November">
[2080]16  <!ENTITY ID-YEAR "2013">
[1101]17  <!ENTITY mdash "&#8212;">
[1692]18  <!ENTITY Note "<x:h xmlns:x=''>Note:</x:h>">
[2069]19  <!ENTITY messaging                    "<xref target='Part1' xmlns:x=''/>">
20  <!ENTITY semantics                    "<xref target='Part2' xmlns:x=''/>">
[1452]21  <!ENTITY architecture                 "<xref target='Part1' x:rel='#architecture' xmlns:x=''/>">
[1875]22  <!ENTITY conformance                  "<xref target='Part1' x:rel='#conformance' xmlns:x=''/>">
[424]23  <!ENTITY notation                     "<xref target='Part1' x:rel='#notation' xmlns:x=''/>">
[1518]24  <!ENTITY abnf-extension               "<xref target='Part1' x:rel='#abnf.extension' xmlns:x=''/>">
[1399]25  <!ENTITY acks                         "<xref target='Part1' x:rel='#acks' xmlns:x=''/>">
[1518]26  <!ENTITY whitespace                   "<xref target='Part1' x:rel='#whitespace' xmlns:x=''/>">
27  <!ENTITY field-components             "<xref target='Part1' x:rel='#field.components' xmlns:x=''/>">
[961]28  <!ENTITY effective-request-uri        "<xref target='Part1' x:rel='#effective.request.uri' xmlns:x=''/>">
[1518]29  <!ENTITY msg-orient-and-buffering     "<xref target='Part1' x:rel='#intermediaries' xmlns:x=''/>">
[998]30  <!ENTITY end-to-end.and-hop-by-hop    "<xref target='Part1' x:rel='#end-to-end.and.hop-by-hop.header-fields' xmlns:x=''/>">
[1693]31  <!ENTITY status.403                   "<xref target='Part2' x:rel='#status.403' xmlns:x=''/>">
[1999]32  <!ENTITY caching-authenticated-responses "<xref target='Part6' x:rel='#caching.authenticated.responses' xmlns:x=''/>">
[2229]33  <!ENTITY caching-rqd-no-store         "<xref target='Part6' x:rel='' xmlns:x=''/>">
34  <!ENTITY caching-rsd-private          "<xref target='Part6' x:rel='#cache-response-directive.private' xmlns:x=''/>">
36<?rfc toc="yes" ?>
[29]37<?rfc symrefs="yes" ?>
38<?rfc sortrefs="yes" ?>
[8]39<?rfc compact="yes"?>
40<?rfc subcompact="no" ?>
41<?rfc linkmailto="no" ?>
42<?rfc editing="no" ?>
[205]43<?rfc comments="yes"?>
44<?rfc inline="yes"?>
[799]45<?rfc rfcedstyle="yes"?>
[8]46<?rfc-ext allow-markup-in-artwork="yes" ?>
47<?rfc-ext include-references-in-index="yes" ?>
[1477]48<rfc obsoletes="2616" updates="2617" category="std" x:maturity-level="proposed"
[446]49     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p7-auth-&ID-VERSION;"
[153]50     xmlns:x=''>
[1472]51<x:link rel="prev" basename="p6-cache"/>
[1522]52<x:feedback template="{docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
[1864]55  <title abbrev="HTTP/1.1 Authentication">Hypertext Transfer Protocol (HTTP/1.1): Authentication</title>
[29]57  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
[1106]58    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[8]59    <address>
60      <postal>
[1106]61        <street>345 Park Ave</street>
62        <city>San Jose</city>
[8]63        <region>CA</region>
[1106]64        <code>95110</code>
[29]65        <country>USA</country>
[8]66      </postal>
[29]67      <email></email>
68      <uri></uri>
[8]69    </address>
70  </author>
[95]72  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
73    <organization abbrev="greenbytes">greenbytes GmbH</organization>
74    <address>
75      <postal>
76        <street>Hafenweg 16</street>
77        <city>Muenster</city><region>NW</region><code>48155</code>
78        <country>Germany</country>
79      </postal>
[609]80      <email></email>
81      <uri></uri>
[95]82    </address>
83  </author>
[2495]85  <date month="&ID-MONTH;" year="&ID-YEAR;" day="17"/>
[440]86  <workgroup>HTTPbis Working Group</workgroup>
[1373]90   The Hypertext Transfer Protocol (HTTP) is an application-level protocol for
[1808]91   distributed, collaborative, hypermedia information systems. This document
92   defines the HTTP Authentication framework.
96<note title="Editorial Note (To be removed by RFC Editor)">
97  <t>
[1764]98    Discussion of this draft takes place on the HTTPBIS working group
[1268]99    mailing list (, which is archived at
100    <eref target=""/>.
101  </t>
102  <t>
103    The current issues list is at
104    <eref target=""/> and related
105    documents (including fancy diffs) can be found at
[324]106    <eref target=""/>.
[36]107  </t>
[153]108  <t>
[2414]109    The changes in this draft are summarized in <xref target="changes.since.24"/>.
[153]110  </t>
114<section title="Introduction" anchor="introduction">
[998]116   This document defines HTTP/1.1 access control and authentication. It
117   includes the relevant parts of <xref target="RFC2616" x:fmt="none">RFC 2616</xref>
[1636]118   with only minor changes (<xref target="RFC2616"/>), plus the general framework for HTTP authentication,
[998]119   as previously defined in "HTTP Authentication: Basic and Digest Access
120   Authentication" (<xref target="RFC2617"/>).
123   HTTP provides several &OPTIONAL; challenge-response authentication
[2211]124   schemes that can be used by a server to challenge a client request and
[998]125   by a client to provide authentication information. The "basic" and "digest"
126   authentication schemes continue to be specified in
127   <xref target="RFC2617" x:fmt="none">RFC 2617</xref>.
[1875]130<section title="Conformance and Error Handling" anchor="conformance">
132   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
133   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
134   document are to be interpreted as described in <xref target="RFC2119"/>.
[1875]137   Conformance criteria and considerations regarding error handling
138   are defined in &conformance;.
[424]142<section title="Syntax Notation" anchor="notation">
[1518]144   This specification uses the Augmented Backus-Naur Form (ABNF) notation
145   of <xref target="RFC5234"/> with the list rule extension defined in
[2358]146   &abnf-extension;. <xref target="imported.abnf"/> describes rules imported from
[1805]147   other documents. <xref target="collected.abnf"/> shows the collected ABNF
[1518]148   with the list rule expanded.
[998]153<section title="Access Authentication Framework" anchor="access.authentication.framework">
155<section title="Challenge and Response" anchor="challenge.and.response">
[998]156  <x:anchor-alias value="auth-scheme"/>
157  <x:anchor-alias value="auth-param"/>
[1815]158  <x:anchor-alias value="token68"/>
[229]159  <x:anchor-alias value="challenge"/>
160  <x:anchor-alias value="credentials"/>
[2211]162   HTTP provides a simple challenge-response authentication framework
[998]163   that can be used by a server to challenge a client request and by a
[2229]164   client to provide authentication information. It uses a case-insensitive
165   token as a means to identify the authentication scheme, followed
[1394]166   by additional information necessary for achieving authentication via that
[1473]167   scheme. The latter can either be a comma-separated list of parameters or a
168   single sequence of characters capable of holding base64-encoded
[1394]169   information.
172   Parameters are name-value pairs where the name is matched case-insensitively,
173   and each parameter name &MUST; only occur once per challenge.
[1902]175<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="auth-scheme"/><iref primary="true" item="Grammar" subitem="auth-param"/><iref primary="true" item="Grammar" subitem="token68"/>
[1386]176  auth-scheme    = <x:ref>token</x:ref>
[1386]178  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> )
[1815]180  token68        = 1*( <x:ref>ALPHA</x:ref> / <x:ref>DIGIT</x:ref> /
[1394]181                       "-" / "." / "_" / "~" / "+" / "/" ) *"="
[1815]184   The "token68" syntax allows the 66 unreserved URI characters (<xref target="RFC3986"/>),
[1394]185   plus a few others, so that it can hold a base64, base64url (URL and filename
186   safe alphabet), base32, or base16 (hex) encoding, with or without padding, but
187   excluding whitespace (<xref target="RFC4648"/>).
[1708]190   The <x:ref>401 (Unauthorized)</x:ref> response message is used by an origin server
[998]191   to challenge the authorization of a user agent. This response &MUST;
[1736]192   include a <x:ref>WWW-Authenticate</x:ref> header field containing at least one
[1344]193   challenge applicable to the requested resource.
[1736]196   The <x:ref>407 (Proxy Authentication Required)</x:ref> response message is
197   used by a proxy to challenge the authorization of a client and &MUST;
198   include a <x:ref>Proxy-Authenticate</x:ref> header field containing at least
199   one challenge applicable to the proxy for the requested resource.
[1902]201<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="challenge"/>
[1815]202  <x:ref>challenge</x:ref>   = <x:ref>auth-scheme</x:ref> [ 1*<x:ref>SP</x:ref> ( <x:ref>token68</x:ref> / #<x:ref>auth-param</x:ref> ) ]
205  <t>
[1692]206     &Note; Many clients fail to parse challenges containing unknown
[1343]207     schemes. A workaround for this problem is to list well-supported schemes
[1344]208     (such as "basic") first.<!-- see -->
[1018]209  </t>
[1344]212   A user agent that wishes to authenticate itself with an origin server
[1708]213   &mdash; usually, but not necessarily, after receiving a <x:ref>401 (Unauthorized)</x:ref>
[1736]214   &mdash; can do so by including an <x:ref>Authorization</x:ref> header field with the
[1344]215   request.
218   A client that wishes to authenticate itself with a proxy &mdash; usually,
[1708]219   but not necessarily, after receiving a <x:ref>407 (Proxy Authentication Required)</x:ref>
[1736]220   &mdash; can do so by including a <x:ref>Proxy-Authorization</x:ref> header field with the
[1344]221   request.
[1736]224   Both the <x:ref>Authorization</x:ref> field value and the <x:ref>Proxy-Authorization</x:ref> field value
[1669]225   contain the client's credentials for the realm of the resource being
[2229]226   requested, based upon a challenge received in a response (possibly at
[1669]227   some point in the past). When creating their values, the user agent ought to
228   do so by selecting the challenge with what it considers to be the most
229   secure auth-scheme that it understands, obtaining credentials from the user
230   as appropriate.
[1902]232<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="credentials"/>
[1815]233  <x:ref>credentials</x:ref> = <x:ref>auth-scheme</x:ref> [ 1*<x:ref>SP</x:ref> ( <x:ref>token68</x:ref> / #<x:ref>auth-param</x:ref> ) ]
[2449]236   Upon receipt of a request for a protected resource that omits credentials,
237   contains invalid credentials (e.g., a bad password) or partial credentials
238   (e.g., when the authentication scheme requires more than one round trip), an
239   origin server &SHOULD; send a <x:ref>401 (Unauthorized)</x:ref> response that
[2066]240   contains a <x:ref>WWW-Authenticate</x:ref> header field with at least one
241   (possibly new) challenge applicable to the requested resource.
[2449]244   Likewise, upon receipt of a request that requires authentication by proxies
245   that omit credentials or contain invalid or partial credentials, a proxy
246   &SHOULD; send a <x:ref>407 (Proxy Authentication Required)</x:ref> response
247   that contains a <x:ref>Proxy-Authenticate</x:ref> header field with a
248   (possibly new) challenge applicable to the proxy.
[1681]251   A server receiving credentials that are valid, but not adequate to gain
[1713]252   access, ought to respond with the <x:ref>403 (Forbidden)</x:ref> status code (&status.403;).
[2463]255   HTTP does not restrict applications to this simple challenge-response
256   framework for access authentication. Additional mechanisms can be used, such
257   as authentication at the transport level or via message encapsulation, and
258   with additional header fields specifying authentication information. However,
259   such additional mechanisms are not defined by this specification.
[2402]262   A proxy &MUST; forward the <x:ref>WWW-Authenticate</x:ref> and
[1736]263   <x:ref>Authorization</x:ref> header fields unmodified and follow the rules
264   found in <xref target="header.authorization"/>.
[1344]268<section title="Protection Space (Realm)" anchor="">
[1354]269  <iref item="Protection Space"/>
270  <iref item="Realm"/>
[1672]271  <iref item="Canonical Root URI"/>
[1354]273   The authentication parameter realm is reserved for use by authentication
[1478]274   schemes that wish to indicate the scope of protection.
[1354]277   A <x:dfn>protection space</x:dfn> is defined by the canonical root URI (the
278   scheme and authority components of the effective request URI; see
279   <xref target="Part1" x:fmt="of" x:rel="#effective.request.uri"/>) of the
280   server being accessed, in combination with the realm value if present.
[1344]281   These realms allow the protected resources on a server to be
282   partitioned into a set of protection spaces, each with its own
283   authentication scheme and/or authorization database. The realm value
[2393]284   is a string, generally assigned by the origin server, which can have
[2229]285   additional semantics specific to the authentication scheme. Note that a
286   response can have multiple challenges with the same auth-scheme but
[1344]287   different realms.
290   The protection space determines the domain over which credentials can
291   be automatically applied. If a prior request has been authorized, the
[2402]292   user agent &MAY; reuse the same credentials for all other requests within
[2457]293   that protection space for a period of time determined by the authentication
294   scheme, parameters, and/or user preferences (such as a configurable
295   inactivity timeout). Unless specifically allowed by the authentication
296   scheme, a single protection space cannot extend outside the scope of its
297   server.
[2402]300   For historical reasons, a sender &MUST; only generate the quoted-string syntax.
[1478]301   Recipients might have to support both token and quoted-string syntax for
302   maximum interoperability with existing clients that have been accepting both
303   notations for a long time.
[838]309<section title="Status Code Definitions" anchor="status.code.definitions">
[39]310<section title="401 Unauthorized" anchor="status.401">
311  <iref primary="true" item="401 Unauthorized (status code)" x:for-anchor=""/>
[1708]312  <x:anchor-alias value="401 (Unauthorized)"/>
[2066]314   The <x:dfn>401 (Unauthorized)</x:dfn> status code indicates that the
315   request has not been applied because it lacks valid authentication
316   credentials for the target resource. The origin server &MUST; send a
[1736]317   <x:ref>WWW-Authenticate</x:ref> header field (<xref target="header.www-authenticate"/>)
[2066]318   containing at least one challenge applicable to the target resource.
319   If the request included authentication credentials, then the 401 response
320   indicates that authorization has been refused for those credentials.
[2229]321   The user agent &MAY; repeat the request with a new or replaced
[2066]322   <x:ref>Authorization</x:ref> header field (<xref target="header.authorization"/>).
323   If the 401 response contains the same challenge as the prior response, and
324   the user agent has already attempted authentication at least once, then the
325   user agent &SHOULD; present the enclosed representation to the user, since
326   it usually contains relevant diagnostic information.
329<section title="407 Proxy Authentication Required" anchor="status.407">
330  <iref primary="true" item="407 Proxy Authentication Required (status code)" x:for-anchor=""/>
[1708]331  <x:anchor-alias value="407 (Proxy Authentication Required)"/>
[2066]333   The <x:dfn>407 (Proxy Authentication Required)</x:dfn> status code is
334   similar to <x:ref>401 (Unauthorized)</x:ref>, but indicates that the client
335   needs to authenticate itself in order to use a proxy.
336   The proxy &MUST; send a <x:ref>Proxy-Authenticate</x:ref> header field
337   (<xref target="header.proxy-authenticate"/>) containing a challenge
338   applicable to that proxy for the target resource. The client &MAY; repeat
339   the request with a new or replaced <x:ref>Proxy-Authorization</x:ref>
[998]340   header field (<xref target="header.proxy-authorization"/>).
[1415]345<section title="Header Field Definitions" anchor="header.field.definitions">
[117]347   This section defines the syntax and semantics of HTTP/1.1 header fields
348   related to authentication.
351<section title="Authorization" anchor="header.authorization">
[1120]352  <iref primary="true" item="Authorization header field" x:for-anchor=""/>
[229]353  <x:anchor-alias value="Authorization"/>
[2398]355   The "Authorization" header field allows a user agent to authenticate itself
356   with an origin server &mdash; usually, but not necessarily, after receiving
357   a <x:ref>401 (Unauthorized)</x:ref> response. Its value consists of
358   credentials containing the authentication information of the user agent for
359   the realm of the resource being requested.
[1230]361<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Authorization"/>
362  <x:ref>Authorization</x:ref> = <x:ref>credentials</x:ref>
[2398]365   If a request is authenticated and a realm specified, the same credentials
366   are presumed to be valid for all other requests within this realm (assuming
367   that the authentication scheme itself does not require otherwise, such as
368   credentials that vary according to a challenge value or using synchronized
369   clocks).
[1999]372   See &caching-authenticated-responses; for details of and requirements
373   pertaining to handling of the Authorization field by HTTP caches.
377<section title="Proxy-Authenticate" anchor="header.proxy-authenticate">
[1120]378  <iref primary="true" item="Proxy-Authenticate header field" x:for-anchor=""/>
[229]379  <x:anchor-alias value="Proxy-Authenticate"/>
[1601]381   The "Proxy-Authenticate" header field consists of at least one
382   challenge that indicates the authentication scheme(s) and parameters
383   applicable to the proxy for this effective request URI (&effective-request-uri;).
[1708]384   It &MUST; be included as part of a <x:ref>407 (Proxy Authentication Required)</x:ref> response.
[1230]386<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Proxy-Authenticate"/>
387  <x:ref>Proxy-Authenticate</x:ref> = 1#<x:ref>challenge</x:ref>
[1736]390   Unlike <x:ref>WWW-Authenticate</x:ref>, the Proxy-Authenticate header field
[2326]391   applies only to the next outbound client on the response chain that chose
392   to direct its request to the responding proxy. If that recipient is also a
393   proxy, it will generally consume the Proxy-Authenticate header field (and
394   generate an appropriate <x:ref>Proxy-Authorization</x:ref> in a subsequent
395   request) rather than forward the header field to its own outbound clients.
396   However, if a recipient proxy needs to obtain its own credentials by
397   requesting them from a further outbound client, it will generate its own
398   407 response, which might have the appearance of forwarding the
399   Proxy-Authenticate header field if both proxies use the same challenge set.
[1736]402   Note that the parsing considerations for <x:ref>WWW-Authenticate</x:ref>
403   apply to this header field as well; see <xref target="header.www-authenticate"/>
404   for details.
408<section title="Proxy-Authorization" anchor="header.proxy-authorization">
[1120]409  <iref primary="true" item="Proxy-Authorization header field" x:for-anchor=""/>
[229]410  <x:anchor-alias value="Proxy-Authorization"/>
[1163]412   The "Proxy-Authorization" header field allows the client to
[2074]413   identify itself (or its user) to a proxy that requires
[2229]414   authentication. Its value consists of credentials containing the
415   authentication information of the client for the proxy and/or realm of the
416   resource being requested.
[1230]418<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Proxy-Authorization"/>
419  <x:ref>Proxy-Authorization</x:ref> = <x:ref>credentials</x:ref>
[2326]422   Unlike <x:ref>Authorization</x:ref>, the Proxy-Authorization header field
423   applies only to the next inbound proxy that demanded authentication using
424   the <x:ref>Proxy-Authenticate</x:ref> field. When multiple proxies are used
425   in a chain, the Proxy-Authorization header field is consumed by the first
426   inbound proxy that was expecting to receive credentials. A proxy &MAY;
427   relay the credentials from the client request to the next proxy if that is
[8]428   the mechanism by which the proxies cooperatively authenticate a given
429   request.
433<section title="WWW-Authenticate" anchor="header.www-authenticate">
[1120]434  <iref primary="true" item="WWW-Authenticate header field" x:for-anchor=""/>
[229]435  <x:anchor-alias value="WWW-Authenticate"/>
[1163]437   The "WWW-Authenticate" header field consists of at least one
[698]438   challenge that indicates the authentication scheme(s) and parameters
[1360]439   applicable to the effective request URI (&effective-request-uri;).
[1708]442   It &MUST; be included in <x:ref>401 (Unauthorized)</x:ref> response messages and &MAY; be
[1360]443   included in other response messages to indicate that supplying credentials
444   (or different credentials) might affect the response.
[1230]446<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="WWW-Authenticate"/>
447  <x:ref>WWW-Authenticate</x:ref> = 1#<x:ref>challenge</x:ref>
[2455]450   User agents are advised to take special care in parsing the field value, as
451   it might contain more than one challenge, and each challenge can contain a
452   comma-separated list of authentication parameters. Furthermore, the header
453   field itself can occur multiple times.
456  <preamble>For instance:</preamble>
457  <artwork type="example">
458  WWW-Authenticate: Newauth realm="apps", type=1,
459                    title="Login to \"apps\"", Basic realm="simple"
461  <postamble>
462  This header field contains two challenges; one for the "Newauth" scheme
463  with a realm value of "apps", and two additional parameters "type" and
[1533]464  "title", and another one for the "Basic" scheme with a realm value of
465  "simple".
468  <t>
[1692]469    &Note; The challenge grammar production uses the list syntax as
[1533]470    well. Therefore, a sequence of comma, whitespace, and comma can be
[2450]471    considered either as applying to the preceding challenge, or to be an
[1533]472    empty entry in the list of challenges. In practice, this ambiguity
473    does not affect the semantics of the header field value and thus is
474    harmless.
475  </t>
[29]481<section title="IANA Considerations" anchor="IANA.considerations">
[2242]483<section title="Authentication Scheme Registry" anchor="authentication.scheme.registry">
[2242]485   The HTTP Authentication Scheme Registry defines the name space for the
[2245]486   authentication schemes in challenges and credentials. It will be created and
[2424]487   maintained at (the suggested URI) <eref target=""/>.
490<section title="Procedure" anchor="authentication.scheme.registry.procedure">
[2242]492  Registrations &MUST; include the following fields:
493  <list style="symbols">
494    <t>Authentication Scheme Name</t>
495    <t>Pointer to specification text</t>
496    <t>Notes (optional)</t>
497  </list>
500  Values to be added to this name space require IETF Review
501  (see <xref target="RFC5226" x:fmt="," x:sec="4.1"/>).
[2242]505<section title="Considerations for New Authentication Schemes" anchor="">
507  There are certain aspects of the HTTP Authentication Framework that put
508  constraints on how new authentication schemes can work:
511  <list style="symbols">
512    <x:lt>
513    <t>
514      HTTP authentication is presumed to be stateless: all of the information
515      necessary to authenticate a request &MUST; be provided in the request,
516      rather than be dependent on the server remembering prior requests.
517      Authentication based on, or bound to, the underlying connection is
518      outside the scope of this specification and inherently flawed unless
519      steps are taken to ensure that the connection cannot be used by any
520      party other than the authenticated user
521      (see &msg-orient-and-buffering;).
522    </t>
523    </x:lt>
524    <x:lt>
525    <t>
526      The authentication parameter "realm" is reserved for defining Protection
527      Spaces as defined in <xref target=""/>. New schemes
528      &MUST-NOT; use it in a way incompatible with that definition.
529    </t>
530    </x:lt>
531    <x:lt>
532    <t>
533      The "token68" notation was introduced for compatibility with existing
534      authentication schemes and can only be used once per challenge or credential.
535      New schemes thus ought to use the "auth-param" syntax instead, because
536      otherwise future extensions will be impossible.
537    </t>
538    </x:lt>
539    <x:lt>
540    <t>
541      The parsing of challenges and credentials is defined by this specification,
542      and cannot be modified by new authentication schemes. When the auth-param
543      syntax is used, all parameters ought to support both token and
544      quoted-string syntax, and syntactical constraints ought to be defined on
545      the field value after parsing (i.e., quoted-string processing). This is
546      necessary so that recipients can use a generic parser that applies to
547      all authentication schemes.
548    </t>
549    <t>
550      &Note; The fact that the value syntax for the "realm" parameter
551      is restricted to quoted-string was a bad design choice not to be repeated
552      for new parameters.
553    </t>
554    </x:lt>
555    <x:lt>
556    <t>
557      Definitions of new schemes ought to define the treatment of unknown
558      extension parameters. In general, a "must-ignore" rule is preferable
559      over "must-understand", because otherwise it will be hard to introduce
560      new parameters in the presence of legacy recipients. Furthermore,
561      it's good to describe the policy for defining new parameters (such
562      as "update the specification", or "use this registry").
563    </t>
564    </x:lt>
565    <x:lt>
566    <t>
567      Authentication schemes need to document whether they are usable in
568      origin-server authentication (i.e., using <x:ref>WWW-Authenticate</x:ref>),
569      and/or proxy authentication (i.e., using <x:ref>Proxy-Authenticate</x:ref>).
570    </t>
571    </x:lt>
572    <x:lt>
573    <t>
574      The credentials carried in an <x:ref>Authorization</x:ref> header field are specific to
575      the User Agent, and therefore have the same effect on HTTP caches as the
576      "private" Cache-Control response directive (&caching-rsd-private;),
577      within the scope of the request they appear in.
578    </t>
579    <t>
580      Therefore, new authentication schemes that choose not to carry
581      credentials in the <x:ref>Authorization</x:ref> header field (e.g., using a newly defined
582      header field) will need to explicitly disallow caching, by mandating the use of
583      either Cache-Control request directives (e.g., "no-store",
584      &caching-rqd-no-store;) or response directives (e.g., "private").
585    </t>
586    </x:lt>
587  </list>
[700]592<section title="Status Code Registration" anchor="status.code.registration">
594   The HTTP Status Code Registry located at <eref target=""/>
[969]595   shall be updated with the registrations below:
597<?BEGININC p7-auth.iana-status-codes ?>
598<!--AUTOGENERATED FROM extract-status-code-defs.xslt, do not edit manually-->
599<texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
600   <ttcol>Value</ttcol>
601   <ttcol>Description</ttcol>
602   <ttcol>Reference</ttcol>
603   <c>401</c>
604   <c>Unauthorized</c>
605   <c>
606      <xref target="status.401"/>
607   </c>
608   <c>407</c>
609   <c>Proxy Authentication Required</c>
610   <c>
611      <xref target="status.407"/>
612   </c>
615<?ENDINC p7-auth.iana-status-codes ?>
[921]618<section title="Header Field Registration" anchor="header.field.registration">
[2246]620   HTTP header fields are registered within the Message Header Field Registry
621   maintained at
622   <eref target=""/>.
625   This document defines the following HTTP header fields, so their
626   associated registry entries shall be updated according to the permanent
627   registrations below (see <xref target="BCP90"/>):
[680]629<?BEGININC p7-auth.iana-headers ?>
[253]630<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
[290]631<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
[253]632   <ttcol>Header Field Name</ttcol>
633   <ttcol>Protocol</ttcol>
634   <ttcol>Status</ttcol>
635   <ttcol>Reference</ttcol>
637   <c>Authorization</c>
638   <c>http</c>
639   <c>standard</c>
640   <c>
641      <xref target="header.authorization"/>
642   </c>
643   <c>Proxy-Authenticate</c>
644   <c>http</c>
645   <c>standard</c>
646   <c>
647      <xref target="header.proxy-authenticate"/>
648   </c>
649   <c>Proxy-Authorization</c>
650   <c>http</c>
651   <c>standard</c>
652   <c>
653      <xref target="header.proxy-authorization"/>
654   </c>
655   <c>WWW-Authenticate</c>
656   <c>http</c>
657   <c>standard</c>
658   <c>
659      <xref target="header.www-authenticate"/>
660   </c>
[680]663<?ENDINC p7-auth.iana-headers ?>
[290]665   The change controller is: "IETF ( - Internet Engineering Task Force".
670<section title="Security Considerations" anchor="security.considerations">
[2069]672   This section is meant to inform developers, information providers, and
673   users of known security concerns specific to HTTP/1.1 authentication.
674   More general security considerations are addressed in HTTP messaging
675   &messaging; and semantics &semantics;.
678<section title="Authentication Credentials and Idle Clients" anchor="auth.credentials.and.idle.clients">
680   Existing HTTP clients and user agents typically retain authentication
[2399]681   information indefinitely. HTTP does not provide a mechanism for the
682   origin server to direct clients to discard these cached credentials, since
683   the protocol has no awareness of how credentials are obtained or managed
684   by the user agent. The mechanisms for expiring or revoking credentials can
685   be specified as part of an authentication scheme definition.
[8]688   Circumstances under which credential caching can interfere with the
689   application's security model include but are not limited to:
690  <list style="symbols">
[2074]691     <t>Clients that have been idle for an extended period, following
692        which the server might wish to cause the client to re-prompt the
[8]693        user for credentials.</t>
[2074]695     <t>Applications that include a session termination indication
[746]696        (such as a "logout" or "commit" button on a page) after which
697        the server side of the application "knows" that there is no
[8]698        further reason for the client to retain the credentials.</t>
699  </list>
[2399]702   User agents that cache credentials are encouraged to provide a readily
703   accessible mechanism for discarding cached credentials under user control.
707<section title="Protection Spaces" anchor="protection.spaces">
709  Authentication schemes that solely rely on the "realm" mechanism for
[2229]710  establishing a protection space will expose credentials to all resources on
711  an origin server. Clients that have successfully made authenticated requests
712  with a resource can use the same authentication credentials for other
713  resources on the same origin server. This makes it possible for a different
714  resource to harvest authentication credentials for other resources.
[2229]717  This is of particular concern when an origin server hosts resources for multiple
[1791]718  parties under the same canonical root URI (<xref target=""/>).
[1672]719  Possible mitigation strategies include restricting direct access to
720  authentication credentials (i.e., not making the content of the
[1736]721  <x:ref>Authorization</x:ref> request header field available), and separating protection
[2229]722  spaces by using a different host name (or port number) for each party.
[1364]727<section title="Acknowledgments" anchor="acks">
[998]729  This specification takes over the definition of the HTTP Authentication
[1363]730  Framework, previously defined in <xref target="RFC2617" x:fmt="none">RFC 2617</xref>.
731  We thank John Franks, Phillip M. Hallam-Baker, Jeffery L. Hostetler, Scott D. Lawrence,
[998]732  Paul J. Leach, Ari Luotonen, and Lawrence C. Stewart for their work
[1389]733  on that specification. See <xref target="RFC2617" x:fmt="of" x:sec="6"/>
[1363]734  for further acknowledgements. 
737  See &acks; for the Acknowledgments related to this document revision.
[119]744<references title="Normative References">
[205]746<reference anchor="Part1">
747  <front>
[1864]748    <title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
[205]749    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
[1106]750      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[205]751      <address><email></email></address>
752    </author>
753    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
754      <organization abbrev="greenbytes">greenbytes GmbH</organization>
755      <address><email></email></address>
756    </author>
757    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
758  </front>
759  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
760  <x:source href="p1-messaging.xml" basename="p1-messaging"/>
[1693]763<reference anchor="Part2">
764  <front>
[1864]765    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
[1693]766    <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
767      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
768      <address><email></email></address>
769    </author>
770    <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
771      <organization abbrev="greenbytes">greenbytes GmbH</organization>
772      <address><email></email></address>
773    </author>
774    <date month="&ID-MONTH;" year="&ID-YEAR;" />
775  </front>
776  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;" />
[1713]777  <x:source basename="p2-semantics" href="p2-semantics.xml">
778    <x:defines>403 (Forbidden)</x:defines>
[1740]779    <x:defines>Location</x:defines>
[1713]780  </x:source>
[31]783<reference anchor="Part6">
[119]784  <front>
[1864]785    <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
[119]786    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
[1106]787      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[119]788      <address><email></email></address>
789    </author>
[601]790    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
[1915]791      <organization>Akamai</organization>
[601]792      <address><email></email></address>
793    </author>
[119]794    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
795      <organization abbrev="greenbytes">greenbytes GmbH</organization>
796      <address><email></email></address>
797    </author>
798    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
799  </front>
800  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
801  <x:source href="p6-cache.xml" basename="p6-cache"/>
[96]804<reference anchor="RFC2119">
805  <front>
806    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
807    <author initials="S." surname="Bradner" fullname="Scott Bradner">
808      <organization>Harvard University</organization>
809      <address><email></email></address>
810    </author>
811    <date month="March" year="1997"/>
812  </front>
813  <seriesInfo name="BCP" value="14"/>
814  <seriesInfo name="RFC" value="2119"/>
[425]817<reference anchor="RFC5234">
818  <front>
819    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
820    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
821      <organization>Brandenburg InternetWorking</organization>
822      <address>
[728]823        <email></email>
824      </address> 
[425]825    </author>
826    <author initials="P." surname="Overell" fullname="Paul Overell">
827      <organization>THUS plc.</organization>
828      <address>
[728]829        <email></email>
830      </address>
[425]831    </author>
832    <date month="January" year="2008"/>
833  </front>
834  <seriesInfo name="STD" value="68"/>
835  <seriesInfo name="RFC" value="5234"/>
840<references title="Informative References">
842<reference anchor="RFC2616">
843  <front>
844    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
845    <author initials="R." surname="Fielding" fullname="R. Fielding">
846      <organization>University of California, Irvine</organization>
847      <address><email></email></address>
848    </author>
849    <author initials="J." surname="Gettys" fullname="J. Gettys">
850      <organization>W3C</organization>
851      <address><email></email></address>
852    </author>
853    <author initials="J." surname="Mogul" fullname="J. Mogul">
854      <organization>Compaq Computer Corporation</organization>
855      <address><email></email></address>
856    </author>
857    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
858      <organization>MIT Laboratory for Computer Science</organization>
859      <address><email></email></address>
860    </author>
861    <author initials="L." surname="Masinter" fullname="L. Masinter">
862      <organization>Xerox Corporation</organization>
863      <address><email></email></address>
864    </author>
865    <author initials="P." surname="Leach" fullname="P. Leach">
866      <organization>Microsoft Corporation</organization>
867      <address><email></email></address>
868    </author>
869    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
870      <organization>W3C</organization>
871      <address><email></email></address>
872    </author>
873    <date month="June" year="1999"/>
874  </front>
875  <seriesInfo name="RFC" value="2616"/>
[998]878<reference anchor="RFC2617">
879  <front>
880    <title abbrev="HTTP Authentication">HTTP Authentication: Basic and Digest Access Authentication</title>
881    <author initials="J." surname="Franks" fullname="John Franks">
882      <organization>Northwestern University, Department of Mathematics</organization>
883      <address><email></email></address>
884    </author>
885    <author initials="P.M." surname="Hallam-Baker" fullname="Phillip M. Hallam-Baker">
886      <organization>Verisign Inc.</organization>
887      <address><email></email></address>
888    </author>
889    <author initials="J.L." surname="Hostetler" fullname="Jeffery L. Hostetler">
890      <organization>AbiSource, Inc.</organization>
891      <address><email></email></address>
892    </author>
893    <author initials="S.D." surname="Lawrence" fullname="Scott D. Lawrence">
894      <organization>Agranat Systems, Inc.</organization>
895      <address><email></email></address>
896    </author>
897    <author initials="P.J." surname="Leach" fullname="Paul J. Leach">
898      <organization>Microsoft Corporation</organization>
899      <address><email></email></address>
900    </author>
901    <author initials="A." surname="Luotonen" fullname="Ari Luotonen">
902      <organization>Netscape Communications Corporation</organization>
903    </author>
904    <author initials="L." surname="Stewart" fullname="Lawrence C. Stewart">
905      <organization>Open Market, Inc.</organization>
906      <address><email></email></address>
907    </author>
908    <date month="June" year="1999"/>
909  </front>
910  <seriesInfo name="RFC" value="2617"/>
[2046]913<reference anchor='BCP90'>
[253]914  <front>
915    <title>Registration Procedures for Message Header Fields</title>
916    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
917      <organization>Nine by Nine</organization>
918      <address><email></email></address>
919    </author>
920    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
921      <organization>BEA Systems</organization>
922      <address><email></email></address>
923    </author>
924    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
925      <organization>HP Labs</organization>
926      <address><email></email></address>
927    </author>
928    <date year='2004' month='September' />
929  </front>
930  <seriesInfo name='BCP' value='90' />
931  <seriesInfo name='RFC' value='3864' />
[1394]934<reference anchor="RFC3986">
935 <front>
936  <title abbrev='URI Generic Syntax'>Uniform Resource Identifier (URI): Generic Syntax</title>
937  <author initials='T.' surname='Berners-Lee' fullname='Tim Berners-Lee'>
938    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
939    <address>
940       <email></email>
941       <uri></uri>
942    </address>
943  </author>
944  <author initials='R.' surname='Fielding' fullname='Roy T. Fielding'>
945    <organization abbrev="Day Software">Day Software</organization>
946    <address>
947      <email></email>
948      <uri></uri>
949    </address>
950  </author>
951  <author initials='L.' surname='Masinter' fullname='Larry Masinter'>
952    <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
953    <address>
954      <email></email>
955      <uri></uri>
956    </address>
957  </author>
958  <date month='January' year='2005'></date>
959 </front>
960 <seriesInfo name="STD" value="66"/>
961 <seriesInfo name="RFC" value="3986"/>
964<reference anchor="RFC4648">
965  <front>
966    <title>The Base16, Base32, and Base64 Data Encodings</title>
967    <author fullname="S. Josefsson" initials="S." surname="Josefsson"/>
968    <date year="2006" month="October"/>
969  </front>
970  <seriesInfo value="4648" name="RFC"/>
[1026]973<reference anchor='RFC5226'>
974  <front>
975    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
976    <author initials='T.' surname='Narten' fullname='T. Narten'>
977      <organization>IBM</organization>
978      <address><email></email></address>
979    </author>
980    <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'>
981      <organization>Google</organization>
982      <address><email></email></address>
983    </author>
984    <date year='2008' month='May' />
985  </front>
986  <seriesInfo name='BCP' value='26' />
987  <seriesInfo name='RFC' value='5226' />
[1385]992<section title="Changes from RFCs 2616 and 2617" anchor="changes.from.rfc.2616">
[2019]994  The framework for HTTP Authentication is now defined by this document,
995  rather than RFC 2617.
998  The "realm" parameter is no longer always required on challenges;
999  consequently, the ABNF allows challenges without any auth parameters.
[1385]1000  (<xref target="access.authentication.framework"/>)
[1815]1003  The "token68" alternative to auth-param lists has been added for consistency
[1394]1004  with legacy authentication schemes such as "Basic".
1005  (<xref target="access.authentication.framework"/>)
[2019]1008  This specification introduces the Authentication Scheme Registry, along with
1009  considerations for new authentication schemes.
[1760]1010  (<xref target="authentication.scheme.registry"/>)
[1805]1014<section title="Imported ABNF" anchor="imported.abnf">
1015  <x:anchor-alias value="ALPHA"/>
1016  <x:anchor-alias value="CR"/>
1017  <x:anchor-alias value="DIGIT"/>
1018  <x:anchor-alias value="LF"/>
1019  <x:anchor-alias value="OCTET"/>
1020  <x:anchor-alias value="VCHAR"/>
1021  <x:anchor-alias value="SP"/>
1022  <x:anchor-alias value="quoted-string"/>
1023  <x:anchor-alias value="token"/>
1024  <x:anchor-alias value="BWS"/>
1025  <x:anchor-alias value="OWS"/>
1027  The following core rules are included by
1028  reference, as defined in <xref target="RFC5234" x:fmt="of" x:sec="B.1"/>:
1029  ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
1030  DIGIT (decimal 0-9), DQUOTE (double quote),
1031  HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed),
1032  OCTET (any 8-bit sequence of data), SP (space), and
1033  VCHAR (any visible US-ASCII character).
1036   The rules below are defined in <xref target="Part1"/>:
1038<figure><artwork type="abnf2616">
1039  <x:ref>BWS</x:ref>           = &lt;BWS, defined in &whitespace;&gt;
1040  <x:ref>OWS</x:ref>           = &lt;OWS, defined in &whitespace;&gt;
1041  <x:ref>quoted-string</x:ref> = &lt;quoted-string, defined in &field-components;&gt;
1042  <x:ref>token</x:ref>         = &lt;token, defined in &field-components;&gt;
[680]1046<?BEGININC p7-auth.abnf-appendix ?>
[427]1047<section xmlns:x="" title="Collected ABNF" anchor="collected.abnf">
1049  In the collected ABNF below, list rules are expanded as per <xref target="Part1" x:rel="#notation"/>.
[427]1051<artwork type="abnf" name="p7-auth.parsed-abnf">
[1230]1052<x:ref>Authorization</x:ref> = credentials
[2045]1054<x:ref>BWS</x:ref> = &lt;BWS, defined in [Part1], Section 3.2.3&gt;
[2045]1056<x:ref>OWS</x:ref> = &lt;OWS, defined in [Part1], Section 3.2.3&gt;
[1230]1058<x:ref>Proxy-Authenticate</x:ref> = *( "," OWS ) challenge *( OWS "," [ OWS
[425]1059 challenge ] )
[1230]1060<x:ref>Proxy-Authorization</x:ref> = credentials
[1230]1062<x:ref>WWW-Authenticate</x:ref> = *( "," OWS ) challenge *( OWS "," [ OWS challenge
1063 ] )
[1386]1065<x:ref>auth-param</x:ref> = token BWS "=" BWS ( token / quoted-string )
[998]1066<x:ref>auth-scheme</x:ref> = token
[1815]1068<x:ref>challenge</x:ref> = auth-scheme [ 1*SP ( token68 / [ ( "," / auth-param ) *(
[1394]1069 OWS "," [ OWS auth-param ] ) ] ) ]
[1815]1070<x:ref>credentials</x:ref> = auth-scheme [ 1*SP ( token68 / [ ( "," / auth-param )
[1394]1071 *( OWS "," [ OWS auth-param ] ) ] ) ]
[2045]1073<x:ref>quoted-string</x:ref> = &lt;quoted-string, defined in [Part1], Section 3.2.6&gt;
[2045]1075<x:ref>token</x:ref> = &lt;token, defined in [Part1], Section 3.2.6&gt;
[1815]1076<x:ref>token68</x:ref> = 1*( ALPHA / DIGIT / "-" / "." / "_" / "~" / "+" / "/" )
1077 *"="
[680]1081<?ENDINC p7-auth.abnf-appendix ?>
[252]1083<section title="Change Log (to be removed by RFC Editor before publication)"  anchor="change.log">
[2434]1085  Changes up to the IETF Last Call draft are summarized
1086  in <eref target=""/>.
[2414]1089<section title="Since draft-ietf-httpbis-p7-auth-24" anchor="changes.since.24">
[2448]1091  Closed issues:
[2446]1092  <list style="symbols">
1093    <t>
[2477]1094      <eref target=""/>:
1095      "SECDIR review of draft-ietf-httpbis-p7-auth-24"
1096    </t>
1097    <t>
[2446]1098      <eref target=""/>:
1099      "APPSDIR review of draft-ietf-httpbis-p7-auth-24"
1100    </t>
[2455]1101    <t>
1102      <eref target=""/>:
1103      "note about WWW-A parsing potentially misleading"
1104    </t>
[2446]1105  </list>
Note: See TracBrowser for help on using the repository browser.