1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5              This file is generated from xml source: DO NOT EDIT
6        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7      -->
8<title>mod_auth_digest - Apache HTTP Server</title>
9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
12<script src="/style/scripts/prettify.js" type="text/javascript">
13</script>
14
15<link href="/images/favicon.ico" rel="shortcut icon" /></head>
16<body>
17<div id="page-header">
18<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
19<p class="apache">Apache HTTP Server Version 2.2</p>
20<img alt="" src="/images/feather.gif" /></div>
21<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
22<div id="path">
23<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.2</a> &gt; <a href="./">Modules</a></div>
24<div id="page-content">
25<div id="preamble"><h1>Apache Module mod_auth_digest</h1>
26<div class="toplang">
27<p><span>Available Languages: </span><a href="/en/mod/mod_auth_digest.html" title="English">&nbsp;en&nbsp;</a> |
28<a href="/fr/mod/mod_auth_digest.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
29<a href="/ko/mod/mod_auth_digest.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
30</div>
31<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>User authentication using MD5
32    Digest Authentication.</td></tr>
33<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
34<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>auth_digest_module</td></tr>
35<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_auth_digest.c</td></tr></table>
36<h3>Summary</h3>
37
38    <p>This module implements HTTP Digest Authentication
39    (<a href="http://www.faqs.org/rfcs/rfc2617.html">RFC2617</a>), and
40    provides a more secure alternative to <code class="module"><a href="/mod/mod_auth_basic.html">mod_auth_basic</a></code>.</p>
41</div>
42<div id="quickview"><h3 class="directives">Directives</h3>
43<ul id="toc">
44<li><img alt="" src="/images/down.gif" /> <a href="#authdigestalgorithm">AuthDigestAlgorithm</a></li>
45<li><img alt="" src="/images/down.gif" /> <a href="#authdigestdomain">AuthDigestDomain</a></li>
46<li><img alt="" src="/images/down.gif" /> <a href="#authdigestnccheck">AuthDigestNcCheck</a></li>
47<li><img alt="" src="/images/down.gif" /> <a href="#authdigestnonceformat">AuthDigestNonceFormat</a></li>
48<li><img alt="" src="/images/down.gif" /> <a href="#authdigestnoncelifetime">AuthDigestNonceLifetime</a></li>
49<li><img alt="" src="/images/down.gif" /> <a href="#authdigestprovider">AuthDigestProvider</a></li>
50<li><img alt="" src="/images/down.gif" /> <a href="#authdigestqop">AuthDigestQop</a></li>
51<li><img alt="" src="/images/down.gif" /> <a href="#authdigestshmemsize">AuthDigestShmemSize</a></li>
52</ul>
53<h3>Topics</h3>
54<ul id="topics">
55<li><img alt="" src="/images/down.gif" /> <a href="#using">Using Digest Authentication</a></li>
56</ul><h3>See also</h3>
57<ul class="seealso">
58<li><code class="directive"><a href="/mod/core.html#authname">AuthName</a></code></li>
59<li><code class="directive"><a href="/mod/core.html#authtype">AuthType</a></code></li>
60<li><code class="directive"><a href="/mod/core.html#require">Require</a></code></li>
61<li><code class="directive"><a href="/mod/core.html#satisfy">Satisfy</a></code></li>
62<li><a href="/howto/auth.html">Authentication howto</a></li>
63</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
64<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
65<div class="section">
66<h2><a name="using" id="using">Using Digest Authentication</a></h2>
67
68    <p>Using MD5 Digest authentication is very simple. Simply set
69    up authentication normally, using <code>AuthType Digest</code> and
70    <code class="directive"><a href="#authdigestprovider">AuthDigestProvider</a></code>
71    instead of the normal <code>AuthType Basic</code> and
72    <code class="directive"><a href="/mod/mod_auth_basic.html#authbasicprovider">AuthBasicProvider</a></code>.
73    Then add a <code class="directive"><a href="#authdigestdomain">AuthDigestDomain</a></code> directive containing at least the root
74    URI(s) for this protection space.</p>
75
76    <p>Appropriate user (text) files can be created using the
77    <code class="program"><a href="/programs/htdigest.html">htdigest</a></code> tool.</p>
78
79    <div class="example"><h3>Example:</h3><p><code>
80      &lt;Location /private/&gt;<br />
81      <span class="indent">
82        AuthType Digest<br />
83        AuthName "private area"<br />
84        AuthDigestDomain /private/ http://mirror.my.dom/private2/<br />
85	<br />
86	AuthDigestProvider file<br />
87        AuthUserFile /web/auth/.digest_pw<br />
88        Require valid-user<br />
89      </span>
90      &lt;/Location&gt;
91    </code></p></div>
92
93    <div class="note"><h3>Note</h3> 
94    <p>Digest authentication is more secure than Basic authentication,
95    but only works with supporting browsers. As of this writing (December
96    2012) all major browsers support digest authentication.</p>
97    </div>
98</div>
99<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
100<div class="directive-section"><h2><a name="AuthDigestAlgorithm" id="AuthDigestAlgorithm">AuthDigestAlgorithm</a> <a name="authdigestalgorithm" id="authdigestalgorithm">Directive</a></h2>
101<table class="directive">
102<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Selects the algorithm used to calculate the challenge and
103response hashes in digest authentication</td></tr>
104<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestAlgorithm MD5|MD5-sess</code></td></tr>
105<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDigestAlgorithm MD5</code></td></tr>
106<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
107<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
108<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
109<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
110</table>
111    <p>The <code class="directive">AuthDigestAlgorithm</code> directive
112    selects the algorithm used to calculate the challenge and response
113    hashes.</p>
114
115    <div class="note">
116      <code>MD5-sess</code> is not correctly implemented yet.
117    </div>
118    
119
120</div>
121<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
122<div class="directive-section"><h2><a name="AuthDigestDomain" id="AuthDigestDomain">AuthDigestDomain</a> <a name="authdigestdomain" id="authdigestdomain">Directive</a></h2>
123<table class="directive">
124<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URIs that are in the same protection space for digest
125authentication</td></tr>
126<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestDomain <var>URI</var> [<var>URI</var>] ...</code></td></tr>
127<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
128<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
129<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
130<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
131</table>
132    <p>The <code class="directive">AuthDigestDomain</code> directive allows
133    you to specify one or more URIs which are in the same protection
134    space (<em>i.e.</em> use the same realm and username/password info).
135    The specified URIs are prefixes; the client will assume
136    that all URIs "below" these are also protected by the same
137    username/password. The URIs may be either absolute URIs (<em>i.e.</em>
138    including a scheme, host, port, etc.) or relative URIs.</p>
139
140    <p>This directive <em>should</em> always be specified and
141    contain at least the (set of) root URI(s) for this space.
142    Omitting to do so will cause the client to send the
143    Authorization header for <em>every request</em> sent to this
144    server. Apart from increasing the size of the request, it may
145    also have a detrimental effect on performance if <code class="directive"><a href="#authdigestnccheck">AuthDigestNcCheck</a></code> is on.</p>
146
147    <p>The URIs specified can also point to different servers, in
148    which case clients (which understand this) will then share
149    username/password info across multiple servers without
150    prompting the user each time. </p>
151
152</div>
153<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
154<div class="directive-section"><h2><a name="AuthDigestNcCheck" id="AuthDigestNcCheck">AuthDigestNcCheck</a> <a name="authdigestnccheck" id="authdigestnccheck">Directive</a></h2>
155<table class="directive">
156<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables or disables checking of the nonce-count sent by the
157server</td></tr>
158<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestNcCheck On|Off</code></td></tr>
159<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDigestNcCheck Off</code></td></tr>
160<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
161<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
162<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
163</table>
164    <div class="note">
165      Not implemented yet.
166    </div>
167    
168
169</div>
170<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
171<div class="directive-section"><h2><a name="AuthDigestNonceFormat" id="AuthDigestNonceFormat">AuthDigestNonceFormat</a> <a name="authdigestnonceformat" id="authdigestnonceformat">Directive</a></h2>
172<table class="directive">
173<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines how the nonce is generated</td></tr>
174<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestNonceFormat <var>format</var></code></td></tr>
175<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
176<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
177<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
178<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
179</table>
180    <div class="note">Not implemented yet.</div>
181    
182
183</div>
184<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
185<div class="directive-section"><h2><a name="AuthDigestNonceLifetime" id="AuthDigestNonceLifetime">AuthDigestNonceLifetime</a> <a name="authdigestnoncelifetime" id="authdigestnoncelifetime">Directive</a></h2>
186<table class="directive">
187<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>How long the server nonce is valid</td></tr>
188<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestNonceLifetime <var>seconds</var></code></td></tr>
189<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDigestNonceLifetime 300</code></td></tr>
190<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
191<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
192<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
193<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
194</table>
195    <p>The <code class="directive">AuthDigestNonceLifetime</code> directive
196    controls how long the server nonce is valid. When the client
197    contacts the server using an expired nonce the server will send
198    back a 401 with <code>stale=true</code>. If <var>seconds</var> is
199    greater than 0 then it specifies the amount of time for which the
200    nonce is valid; this should probably never be set to less than 10
201    seconds. If <var>seconds</var> is less than 0 then the nonce never
202    expires. 
203    </p>
204
205</div>
206<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
207<div class="directive-section"><h2><a name="AuthDigestProvider" id="AuthDigestProvider">AuthDigestProvider</a> <a name="authdigestprovider" id="authdigestprovider">Directive</a></h2>
208<table class="directive">
209<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the authentication provider(s) for this location</td></tr>
210<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestProvider <var>provider-name</var>
211[<var>provider-name</var>] ...</code></td></tr>
212<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDigestProvider file</code></td></tr>
213<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
214<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
215<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
216<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
217</table>
218    <p>The <code class="directive">AuthDigestProvider</code> directive sets 
219    which provider is used to authenticate the users for this location.
220    The default <code>file</code> provider is implemented
221    by the <code class="module"><a href="/mod/mod_authn_file.html">mod_authn_file</a></code> module.  Make sure
222    that the chosen provider module is present in the server.</p>
223
224    <p>See <code class="module"><a href="/mod/mod_authn_dbm.html">mod_authn_dbm</a></code>, <code class="module"><a href="/mod/mod_authn_file.html">mod_authn_file</a></code>, 
225    and <code class="module"><a href="/mod/mod_authn_dbd.html">mod_authn_dbd</a></code> for providers.</p>
226
227</div>
228<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
229<div class="directive-section"><h2><a name="AuthDigestQop" id="AuthDigestQop">AuthDigestQop</a> <a name="authdigestqop" id="authdigestqop">Directive</a></h2>
230<table class="directive">
231<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines the quality-of-protection to use in digest
232authentication</td></tr>
233<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestQop none|auth|auth-int [auth|auth-int]</code></td></tr>
234<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDigestQop auth</code></td></tr>
235<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
236<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
237<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
238<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
239</table>
240    <p>The <code class="directive">AuthDigestQop</code> directive determines
241    the <dfn>quality-of-protection</dfn> to use. <code>auth</code> will
242    only do authentication (username/password); <code>auth-int</code> is
243    authentication plus integrity checking (an MD5 hash of the entity
244    is also computed and checked); <code>none</code> will cause the module
245    to use the old RFC-2069 digest algorithm (which does not include
246    integrity checking). Both <code>auth</code> and <code>auth-int</code> may
247    be specified, in which the case the browser will choose which of
248    these to use. <code>none</code> should only be used if the browser for
249    some reason does not like the challenge it receives otherwise.</p>
250
251    <div class="note">
252      <code>auth-int</code> is not implemented yet.
253    </div>
254
255</div>
256<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
257<div class="directive-section"><h2><a name="AuthDigestShmemSize" id="AuthDigestShmemSize">AuthDigestShmemSize</a> <a name="authdigestshmemsize" id="authdigestshmemsize">Directive</a></h2>
258<table class="directive">
259<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The amount of shared memory to allocate for keeping track
260of clients</td></tr>
261<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestShmemSize <var>size</var></code></td></tr>
262<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDigestShmemSize 1000</code></td></tr>
263<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
264<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
265<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
266</table>
267    <p>The <code class="directive">AuthDigestShmemSize</code> directive defines
268    the amount of shared memory, that will be allocated at the server
269    startup for keeping track of clients. Note that the shared memory
270    segment cannot be set less than the space that is necessary for
271    tracking at least <em>one</em> client. This value is dependant on your
272    system. If you want to find out the exact value, you may simply
273    set <code class="directive">AuthDigestShmemSize</code> to the value of
274    <code>0</code> and read the error message after trying to start the
275    server.</p>
276
277    <p>The <var>size</var> is normally expressed in Bytes, but you
278    may let the number follow a <code>K</code> or an <code>M</code> to
279    express your value as KBytes or MBytes. For example, the following
280    directives are all equivalent:</p>
281
282    <div class="example"><p><code>
283      AuthDigestShmemSize 1048576<br />
284      AuthDigestShmemSize 1024K<br />
285      AuthDigestShmemSize 1M
286    </code></p></div>
287
288</div>
289</div>
290<div class="bottomlang">
291<p><span>Available Languages: </span><a href="/en/mod/mod_auth_digest.html" title="English">&nbsp;en&nbsp;</a> |
292<a href="/fr/mod/mod_auth_digest.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
293<a href="/ko/mod/mod_auth_digest.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
294</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
295<script type="text/javascript"><!--//--><![CDATA[//><!--
296var comments_shortname = 'httpd';
297var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_auth_digest.html';
298(function(w, d) {
299    if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
300        d.write('<div id="comments_thread"><\/div>');
301        var s = d.createElement('script');
302        s.type = 'text/javascript';
303        s.async = true;
304        s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
305        (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
306    }
307    else { 
308        d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
309    }
310})(window, document);
311//--><!]]></script></div><div id="footer">
312<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
313<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
314if (typeof(prettyPrint) !== 'undefined') {
315    prettyPrint();
316}
317//--><!]]></script>
318</body></html>