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
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" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.0</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
20 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.0</a> > <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_auth_digest</h1>
24 <p><span>Available Languages: </span><a href="../en/mod/mod_auth_digest.html" title="English"> en </a> |
25 <a href="../ko/mod/mod_auth_digest.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
27 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>User authentication using MD5
28 Digest Authentication.</td></tr>
29 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
30 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>auth_digest_module</td></tr>
31 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_auth_digest.c</td></tr></table>
34 <p>This module implements HTTP Digest Authentication. However, it
35 has not been extensively tested and is therefore marked
38 <div id="quickview"><h3 class="directives">Directives</h3>
40 <li><img alt="" src="../images/down.gif" /> <a href="#authdigestalgorithm">AuthDigestAlgorithm</a></li>
41 <li><img alt="" src="../images/down.gif" /> <a href="#authdigestdomain">AuthDigestDomain</a></li>
42 <li><img alt="" src="../images/down.gif" /> <a href="#authdigestfile">AuthDigestFile</a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#authdigestgroupfile">AuthDigestGroupFile</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#authdigestnccheck">AuthDigestNcCheck</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#authdigestnonceformat">AuthDigestNonceFormat</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#authdigestnoncelifetime">AuthDigestNonceLifetime</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#authdigestqop">AuthDigestQop</a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#authdigestshmemsize">AuthDigestShmemSize</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#using">Using Digest Authentication</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#msie">Working with MS Internet Explorer</a></li>
54 </ul><h3>See also</h3>
56 <li><code class="directive"><a href="../mod/core.html#authname">AuthName</a></code></li>
57 <li><code class="directive"><a href="../mod/core.html#authtype">AuthType</a></code></li>
58 <li><code class="directive"><a href="../mod/core.html#require">Require</a></code></li>
59 <li><code class="directive"><a href="../mod/core.html#satisfy">Satisfy</a></code></li>
61 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
63 <h2><a name="using" id="using">Using Digest Authentication</a></h2>
65 <p>Using MD5 Digest authentication is very simple. Simply set
66 up authentication normally, using <code>AuthType Digest</code> and
67 <code class="directive"><a href="#authdigestfile">AuthDigestFile</a></code> instead
68 of the normal <code>AuthType Basic</code> and <code class="directive"><a href="../mod/mod_auth.html#authuserfile">AuthUserFile</a></code>; also, replace any <code class="directive"><a href="../mod/mod_auth.html#authgroupfile">AuthGroupFile</a></code> with <code class="directive"><a href="#authdigestgroupfile">AuthDigestGroupFile</a></code>. Then add a
69 <code class="directive"><a href="#authdigestdomain">AuthDigestDomain</a></code> directive
70 containing at least the root URI(s) for this protection space.</p>
72 <p>Appropriate user (text) files can be created using the
73 <code class="program"><a href="../programs/htdigest.html">htdigest</a></code> tool.</p>
75 <div class="example"><h3>Example:</h3><p><code>
76 <Location /private/><br />
79 AuthName "private area"<br />
80 AuthDigestDomain /private/ http://mirror.my.dom/private2/<br />
81 AuthDigestFile /web/auth/.digest_pw<br />
82 Require valid-user<br />
87 <div class="note"><h3>Note</h3>
88 <p>Digest authentication provides a more secure password system
89 than Basic authentication, but only works with supporting
90 browsers. As of November 2002, the major browsers that support digest
91 authentication are <a href="http://www.opera.com/">Opera</a>, <a href="http://www.microsoft.com/windows/ie/">MS Internet
92 Explorer</a> (fails when used with a query string - see "<a href="#msie">Working with MS Internet Explorer</a>" below for a workaround), <a href="http://www.w3.org/Amaya/">Amaya</a>, <a href="http://www.mozilla.org">Mozilla</a> and <a href="http://channels.netscape.com/ns/browsers/download.jsp">Netscape</a> since version 7. Since digest authentication is not
93 as widely implemented as basic authentication, you should use it only
94 in controlled environments.</p>
96 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
98 <h2><a name="msie" id="msie">Working with MS Internet Explorer</a></h2>
99 <p>The Digest authentication implementation in previous Internet
100 Explorer for Windows versions (5 and 6) had issues, namely that
101 <code>GET</code> requests with a query string were not RFC compliant.
102 There are a few ways to work around this issue.</p>
105 The first way is to use <code>POST</code> requests instead of
106 <code>GET</code> requests to pass data to your program. This method
107 is the simplest approach if your application can work with this
111 <p>Since version 2.0.51 Apache also provides a workaround in the
112 <code>AuthDigestEnableQueryStringHack</code> environment variable.
113 If <code>AuthDigestEnableQueryStringHack</code> is set for the
114 request, Apache will take steps to work around the MSIE bug and
115 remove the query string from the digest comparison. Using this
116 method would look similar to the following.</p>
118 <div class="example"><h3>Using Digest Authentication with MSIE:</h3><p><code>
119 BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On
122 <p>This workaround is not necessary for MSIE 7, though enabling it does
123 not cause any compatibility issues or significant overhead.</p>
125 <p>See the <code class="directive"><a href="../mod/mod_setenvif.html#browsermatch">BrowserMatch</a></code>
126 directive for more details on conditionally setting environment
129 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
130 <div class="directive-section"><h2><a name="AuthDigestAlgorithm" id="AuthDigestAlgorithm">AuthDigestAlgorithm</a> <a name="authdigestalgorithm" id="authdigestalgorithm">Directive</a></h2>
131 <table class="directive">
132 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Selects the algorithm used to calculate the challenge and
133 response hases in digest authentication</td></tr>
134 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestAlgorithm MD5|MD5-sess</code></td></tr>
135 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDigestAlgorithm MD5</code></td></tr>
136 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
137 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
138 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
139 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
141 <p>The <code class="directive">AuthDigestAlgorithm</code> directive
142 selects the algorithm used to calculate the challenge and response
146 <code>MD5-sess</code> is not correctly implemented yet.
151 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
152 <div class="directive-section"><h2><a name="AuthDigestDomain" id="AuthDigestDomain">AuthDigestDomain</a> <a name="authdigestdomain" id="authdigestdomain">Directive</a></h2>
153 <table class="directive">
154 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URIs that are in the same protection space for digest
155 authentication</td></tr>
156 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestDomain <var>URI</var> [<var>URI</var>] ...</code></td></tr>
157 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
158 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
159 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
160 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
162 <p>The <code class="directive">AuthDigestDomain</code> directive allows
163 you to specify one or more URIs which are in the same protection
164 space (<em>i.e.</em> use the same realm and username/password info).
165 The specified URIs are prefixes, <em>i.e.</em> the client will assume
166 that all URIs "below" these are also protected by the same
167 username/password. The URIs may be either absolute URIs (<em>i.e.</em>
168 including a scheme, host, port, etc) or relative URIs.</p>
170 <p>This directive <em>should</em> always be specified and
171 contain at least the (set of) root URI(s) for this space.
172 Omitting to do so will cause the client to send the
173 Authorization header for <em>every request</em> sent to this
174 server. Apart from increasing the size of the request, it may
175 also have a detrimental effect on performance if <code class="directive"><a href="#authdigestnccheck">AuthDigestNcCheck</a></code> is on.</p>
177 <p>The URIs specified can also point to different servers, in
178 which case clients (which understand this) will then share
179 username/password info across multiple servers without
180 prompting the user each time.</p>
183 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
184 <div class="directive-section"><h2><a name="AuthDigestFile" id="AuthDigestFile">AuthDigestFile</a> <a name="authdigestfile" id="authdigestfile">Directive</a></h2>
185 <table class="directive">
186 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location of the text file containing the list
187 of users and encoded passwords for digest authentication</td></tr>
188 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestFile <var>file-path</var></code></td></tr>
189 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
190 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
191 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
192 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
194 <p>The <code class="directive">AuthDigestFile</code> directive sets the
195 name of a textual file containing the list of users and encoded
196 passwords for digest authentication. <var>File-path</var> is the
197 absolute path to the user file.</p>
199 <p>The digest file uses a special format. Files in this format
200 can be created using the <code class="program"><a href="../programs/htdigest.html">htdigest</a></code> utility found in
201 the <code>support/</code> subdirectory of the Apache distribution.</p>
204 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
205 <div class="directive-section"><h2><a name="AuthDigestGroupFile" id="AuthDigestGroupFile">AuthDigestGroupFile</a> <a name="authdigestgroupfile" id="authdigestgroupfile">Directive</a></h2>
206 <table class="directive">
207 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the text file containing the list of groups
208 for digest authentication</td></tr>
209 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestGroupFile <var>file-path</var></code></td></tr>
210 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
211 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
212 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
213 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
215 <p>The <code class="directive">AuthDigestGroupFile</code> directive sets
216 the name of a textual file containing the list of groups and their
217 members (user names). <var>File-path</var> is the absolute path to
220 <p>Each line of the group file contains a groupname followed by
221 a colon, followed by the member usernames separated by spaces.
224 <div class="example"><p><code>mygroup: bob joe anne</code></p></div>
226 <p>Note that searching large text files is <em>very</em>
229 <div class="warning"><h3>Security:</h3>
230 <p>Make sure that the <code class="directive">AuthGroupFile</code> is stored
231 outside the document tree of the web-server; do <em>not</em> put it in
232 the directory that it protects. Otherwise, clients may be able
233 to download the <code class="directive">AuthGroupFile</code>.</p>
237 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
238 <div class="directive-section"><h2><a name="AuthDigestNcCheck" id="AuthDigestNcCheck">AuthDigestNcCheck</a> <a name="authdigestnccheck" id="authdigestnccheck">Directive</a></h2>
239 <table class="directive">
240 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables or disables checking of the nonce-count sent by the
242 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestNcCheck On|Off</code></td></tr>
243 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDigestNcCheck Off</code></td></tr>
244 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
245 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
246 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
254 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
255 <div class="directive-section"><h2><a name="AuthDigestNonceFormat" id="AuthDigestNonceFormat">AuthDigestNonceFormat</a> <a name="authdigestnonceformat" id="authdigestnonceformat">Directive</a></h2>
256 <table class="directive">
257 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines how the nonce is generated</td></tr>
258 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestNonceFormat <var>format</var></code></td></tr>
259 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
260 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
261 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
262 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
264 <div class="note">Not implemented yet.</div>
268 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
269 <div class="directive-section"><h2><a name="AuthDigestNonceLifetime" id="AuthDigestNonceLifetime">AuthDigestNonceLifetime</a> <a name="authdigestnoncelifetime" id="authdigestnoncelifetime">Directive</a></h2>
270 <table class="directive">
271 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>How long the server nonce is valid</td></tr>
272 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestNonceLifetime <var>seconds</var></code></td></tr>
273 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDigestNonceLifetime 300</code></td></tr>
274 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
275 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
276 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
277 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
279 <p>The <code class="directive">AuthDigestNonceLifetime</code> directive
280 controls how long the server nonce is valid. When the client
281 contacts the server using an expired nonce the server will send
282 back a 401 with <code>stale=true</code>. If <var>seconds</var> is
283 greater than 0 then it specifies the amount of time for which the
284 nonce is valid; this should probably never be set to less than 10
285 seconds. If <var>seconds</var> is less than 0 then the nonce never
290 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
291 <div class="directive-section"><h2><a name="AuthDigestQop" id="AuthDigestQop">AuthDigestQop</a> <a name="authdigestqop" id="authdigestqop">Directive</a></h2>
292 <table class="directive">
293 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines the quality-of-protection to use in digest
294 authentication</td></tr>
295 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestQop none|auth|auth-int [auth|auth-int]</code></td></tr>
296 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDigestQop auth</code></td></tr>
297 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
298 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
299 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
300 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
302 <p>The <code class="directive">AuthDigestQop</code> directive determines
303 the <dfn>quality-of-protection</dfn> to use. <code>auth</code> will only do
304 authentication (username/password); <code>auth-int</code> is
305 authentication plus integrity checking (an MD5 hash of the entity
306 is also computed and checked); <code>none</code> will cause the module
307 to use the old RFC-2069 digest algorithm (which does not include
308 integrity checking). Both <code>auth</code> and <code>auth-int</code> may
309 be specified, in which the case the browser will choose which of
310 these to use. <code>none</code> should only be used if the browser for
311 some reason does not like the challenge it receives otherwise.</p>
314 <code>auth-int</code> is not implemented yet.
318 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
319 <div class="directive-section"><h2><a name="AuthDigestShmemSize" id="AuthDigestShmemSize">AuthDigestShmemSize</a> <a name="authdigestshmemsize" id="authdigestshmemsize">Directive</a></h2>
320 <table class="directive">
321 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The amount of shared memory to allocate for keeping track
323 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthDigestShmemSize <var>size</var></code></td></tr>
324 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthDigestShmemSize 1000</code></td></tr>
325 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
326 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
327 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_digest</td></tr>
329 <p>The <code class="directive">AuthDigestShmemSize</code> directive defines
330 the amount of shared memory, that will be allocated at the server
331 startup for keeping track of clients. Note that the shared memory
332 segment cannot be set less than the space that is neccessary for
333 tracking at least <em>one</em> client. This value is dependant on your
334 system. If you want to find out the exact value, you may simply
335 set <code class="directive">AuthDigestShmemSize</code> to the value of
336 <code>0</code> and read the error message after trying to start the
339 <p>The <var>size</var> is normally expressed in Bytes, but you
340 may let the number follow a <code>K</code> or an <code>M</code> to
341 express your value as KBytes or MBytes. For example, the following
342 directives are all equivalent:</p>
344 <div class="example"><p><code>
345 AuthDigestShmemSize 1048576<br />
346 AuthDigestShmemSize 1024K<br />
347 AuthDigestShmemSize 1M
352 <div class="bottomlang">
353 <p><span>Available Languages: </span><a href="../en/mod/mod_auth_digest.html" title="English"> en </a> |
354 <a href="../ko/mod/mod_auth_digest.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
355 </div><div id="footer">
356 <p class="apache">Copyright 2009 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>
357 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>