]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_authn_file.xml
Rebuild
[apache] / docs / manual / mod / mod_authn_file.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_authn_file.xml.meta">
24
25 <name>mod_authn_file</name>
26 <description>User authentication using text files</description>
27 <status>Base</status>
28 <sourcefile>mod_authn_file.c</sourcefile>
29 <identifier>authn_file_module</identifier>
30
31 <summary>
32     <p>This module provides authentication front-ends such as
33     <module>mod_auth_digest</module> and <module>mod_auth_basic</module>
34     to authenticate users by looking up users in plain text password files.
35     Similar functionality is provided by <module>mod_authn_dbm</module>.</p>
36
37     <p>When using <module>mod_auth_basic</module> or
38     <module>mod_auth_digest</module>, this module is invoked via the
39     <directive module="mod_auth_basic">AuthBasicProvider</directive> or
40     <directive module="mod_auth_digest">AuthDigestProvider</directive>
41     with the <code>file</code> value.</p>
42 </summary>
43 <seealso>
44   <directive module="mod_auth_basic">AuthBasicProvider</directive>
45 </seealso>
46 <seealso>
47   <directive module="mod_auth_digest">AuthDigestProvider</directive>
48 </seealso>
49 <seealso><program>htpasswd</program></seealso>
50 <seealso><program>htdigest</program></seealso>
51 <seealso><a href="../misc/password_encryptions.html">Password Formats</a></seealso>
52
53 <directivesynopsis>
54 <name>AuthUserFile</name>
55 <description>Sets the name of a text file containing the list of users and
56 passwords for authentication</description>
57 <syntax>AuthUserFile <var>file-path</var></syntax>
58 <contextlist><context>directory</context><context>.htaccess</context>
59 </contextlist>
60 <override>AuthConfig</override>
61
62 <usage>
63     <p>The <directive>AuthUserFile</directive> directive sets the name
64     of a textual file containing the list of users and passwords for
65     user authentication. <var>File-path</var> is the path to the user
66     file. If it is not absolute, it is treated as relative to the
67     <directive module="core">ServerRoot</directive>.</p>
68
69     <p>Each line of the user file contains a username followed by
70     a colon, followed by the encrypted password. If the same user
71     ID is defined multiple times, <module>mod_authn_file</module> will
72     use the first occurrence to verify the password.</p>
73
74     <p>The encrypted password format depends on which authentication
75     frontend (e.g. <module>mod_auth_basic</module> or
76     <module>mod_auth_digest</module>) is being used.  See <a
77     href="../misc/password_encryptions.html">Password Formats</a> for
78     more information.</p>
79
80     <p>For <module>mod_auth_basic</module>, use the utility <program>htpasswd</program>
81     which is installed as part of the binary distribution, or which
82     can be found in <code>src/support</code>. See the
83     <a href="../programs/htpasswd.html">man page</a> for more details.
84     In short:</p>
85
86     <p>Create a password file <code>Filename</code> with
87     <code>username</code> as the initial ID. It will prompt for
88     the password:</p>
89
90     <example>
91       htpasswd -c Filename username
92     </example>
93
94     <p>Add or modify <code>username2</code> in the password file
95     <code>Filename</code>:</p>
96
97     <example>
98       htpasswd Filename username2
99     </example>
100
101     <p>Note that searching large text files is <em>very</em>
102     inefficient; <directive
103     module="mod_authn_dbm">AuthDBMUserFile</directive> should be used
104     instead.</p>
105
106     <p>For <module>mod_auth_digest</module>, use <program>htdigest</program>
107     instead. Note that you cannot mix user data for Digest Authentication
108     and Basic Authentication within the same file.</p>
109
110     <note type="warning"><title>Security</title>
111       <p>Make sure that the <directive>AuthUserFile</directive> is
112       stored outside the document tree of the web-server. Do
113       <strong>not</strong> put it in the directory that it protects.
114       Otherwise, clients may be able to download the
115       <directive>AuthUserFile</directive>.</p>
116     </note>
117 </usage>
118 </directivesynopsis>
119
120 </modulesynopsis>