]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_authnz_ldap.xml
use example.com instead of other non-standard examples
[apache] / docs / manual / mod / mod_authnz_ldap.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_authnz_ldap.xml.meta">
24
25 <name>mod_authnz_ldap</name>
26 <description>Allows an LDAP directory to be used to store the database
27 for HTTP Basic authentication.</description>
28 <status>Extension</status>
29 <sourcefile>mod_authnz_ldap.c</sourcefile>
30 <identifier>authnz_ldap_module</identifier>
31 <compatibility>Available in version 2.1 and later</compatibility>
32
33 <summary>
34     <p>This module provides authentication front-ends such as
35     <module>mod_auth_basic</module> to authenticate users through 
36     an ldap directory.</p>
37     
38     <p><module>mod_authnz_ldap</module> supports the following features:</p>
39
40     <ul>
41       <li>Known to support the <a
42       href="http://www.openldap.org/">OpenLDAP SDK</a> (both 1.x
43       and 2.x), <a href="http://developer.novell.com/ndk/cldap.htm">
44       Novell LDAP SDK</a> and the <a
45       href="http://www.iplanet.com/downloads/developer/">iPlanet
46       (Netscape)</a> SDK.</li>
47
48       <li>Complex authorization policies can be implemented by
49       representing the policy with LDAP filters.</li>
50
51       <li>Uses extensive caching of LDAP operations via <a
52       href="mod_ldap.html">mod_ldap</a>.</li>
53
54       <li>Support for LDAP over SSL (requires the Netscape SDK) or
55       TLS (requires the OpenLDAP 2.x SDK or Novell LDAP SDK).</li>
56     </ul>
57
58     <p>When using <module>mod_auth_basic</module>, this module is invoked
59     via the <directive module="mod_auth_basic">AuthBasicProvider</directive>
60     directive with the <code>ldap</code> value.</p>
61 </summary>
62
63 <seealso><module>mod_ldap</module></seealso>
64 <seealso><module>mod_auth_basic</module></seealso>
65 <seealso><module>mod_authz_user</module></seealso>
66 <seealso><module>mod_authz_groupfile</module></seealso>
67
68 <section id="contents"><title>Contents</title>
69
70     <ul>
71       <li>
72         <a href="#operation">Operation</a> 
73
74         <ul>
75           <li><a href="#authenphase">The Authentication
76           Phase</a></li>
77
78           <li><a href="#authorphase">The Authorization
79           Phase</a></li>
80         </ul>
81       </li>
82
83       <li>
84         <a href="#requiredirectives">The Require Directives</a> 
85
86         <ul>
87           <li><a href="#requser">Require ldap-user</a></li>
88           <li><a href="#reqgroup">Require ldap-group</a></li>
89           <li><a href="#reqdn">Require ldap-dn</a></li>
90           <li><a href="#reqattribute">Require ldap-attribute</a></li>
91           <li><a href="#reqfilter">Require ldap-filter</a></li>
92         </ul>
93       </li>
94
95       <li><a href="#examples">Examples</a></li>
96       <li><a href="#usingtls">Using TLS</a></li>
97       <li><a href="#usingssl">Using SSL</a></li>
98       <li><a href="#exposed">Exposing Login Information</a></li>
99       <li><a href="#activedirectory">Using Active Directory</a></li>
100       <li>
101         <a href="#frontpage">Using Microsoft FrontPage with
102         <module>mod_authnz_ldap</module></a> 
103
104         <ul>
105           <li><a href="#howitworks">How It Works</a></li>
106           <li><a href="#fpcaveats">Caveats</a></li>
107         </ul>
108       </li>
109     </ul>
110 </section>
111
112 <section id="operation"><title>Operation</title>
113
114     <p>There are two phases in granting access to a user. The first
115     phase is authentication, in which the <module>mod_authnz_ldap</module>
116     authentication provider verifies that the user's credentials are valid. 
117     This is also called the <em>search/bind</em> phase. The second phase is
118     authorization, in which <module>mod_authnz_ldap</module> determines
119     if the authenticated user is allowed access to the resource in
120     question. This is also known as the <em>compare</em>
121     phase.</p>
122
123     <p><module>mod_authnz_ldap</module> registers both an authn_ldap authentication
124     provider and an authz_ldap authorization handler.  The authn_ldap
125     authentication provider can be enabled through the 
126     <directive module="mod_auth_basic">AuthBasicProvider</directive> directive 
127     using the <code>ldap</code> value. The authz_ldap handler extends the 
128     <directive module="mod_authz_core">Require</directive> directive's authorization types
129     by adding <code>ldap-user</code>, <code>ldap-dn</code> and <code>ldap-group</code> 
130     values.</p>
131
132 <section id="authenphase"><title>The Authentication
133     Phase</title>
134
135     <p>During the authentication phase, <module>mod_authnz_ldap</module>
136     searches for an entry in the directory that matches the username
137     that the HTTP client passes. If a single unique match is found,
138     then <module>mod_authnz_ldap</module> attempts to bind to the
139     directory server using the DN of the entry plus the password
140     provided by the HTTP client. Because it does a search, then a
141     bind, it is often referred to as the search/bind phase. Here are
142     the steps taken during the search/bind phase.</p>
143
144     <ol>
145       <li>Generate a search filter by combining the attribute and
146       filter provided in the <directive module="mod_authnz_ldap"
147       >AuthLDAPURL</directive> directive with
148       the username passed by the HTTP client.</li>
149
150       <li>Search the directory using the generated filter. If the
151       search does not return exactly one entry, deny or decline
152       access.</li>
153
154       <li>Fetch the distinguished name of the entry retrieved from
155       the search and attempt to bind to the LDAP server using that
156       DN and the password passed by the HTTP client. If the bind is
157       unsuccessful, deny or decline access.</li>
158     </ol>
159
160     <p>The following directives are used during the search/bind
161     phase</p>
162
163     <table>
164       <columnspec><column width=".3"/><column width=".7"/></columnspec>
165       <tr>
166         <td><directive module="mod_authnz_ldap">AuthLDAPURL</directive></td>
167
168         <td>Specifies the LDAP server, the
169         base DN, the attribute to use in the search, as well as the
170         extra search filter to use.</td>
171       </tr>
172
173       <tr>
174         <td><directive module="mod_authnz_ldap">AuthLDAPBindDN</directive></td>
175
176         <td>An optional DN to bind with
177         during the search phase.</td>
178       </tr>
179
180       <tr>
181         <td><directive
182         module="mod_authnz_ldap">AuthLDAPBindPassword</directive></td>
183
184         <td>An optional password to bind
185         with during the search phase.</td>
186       </tr>
187     </table>
188 </section>
189
190 <section id="authorphase"><title>The Authorization Phase</title>
191
192     <p>During the authorization phase, <module>mod_authnz_ldap</module>
193     attempts to determine if the user is authorized to access the
194     resource.  Many of these checks require
195     <module>mod_authnz_ldap</module> to do a compare operation on the
196     LDAP server. This is why this phase is often referred to as the
197     compare phase. <module>mod_authnz_ldap</module> accepts the
198     following <directive module="mod_authz_core">Require</directive>
199     directives to determine if the credentials are acceptable:</p>
200
201     <ul>
202       <li>Grant access if there is a <a
203       href="#reqgroup"><code>Require ldap-user</code></a> directive, and the
204       username in the directive matches the username passed by the
205       client.</li>
206
207       <li>Grant access if there is a <a href="#reqdn"><code>Require
208       ldap-dn</code></a> directive, and the DN in the directive matches
209       the DN fetched from the LDAP directory.</li>
210
211       <li>Grant access if there is a <a
212       href="#reqgroup"><code>Require ldap-group</code></a> directive, and
213       the DN fetched from the LDAP directory (or the username
214       passed by the client) occurs in the LDAP group or, potentially, in
215       one of its sub-groups.</li>
216
217       <li>Grant access if there is a <a href="#reqattribute">
218       <code>Require ldap-attribute</code></a> 
219       directive, and the attribute fetched from the LDAP directory
220       matches the given value.</li> 
221
222       <li>Grant access if there is a <a href="#reqfilter">
223       <code>Require ldap-filter</code></a> 
224       directive, and the search filter successfully finds a single user
225       object that matches the dn of the authenticated user.</li> 
226
227       <li>otherwise, deny or decline access</li>
228     </ul>
229
230     <p>Other <directive module="mod_authz_core">Require</directive> values may also
231     be used which may require loading additional authorization modules.</p>
232
233     <ul>
234         <li>Grant access to all successfully authenticated users if 
235         there is a <a href="#requser"><code>Require valid-user</code></a> 
236         directive. (requires <module>mod_authz_user</module>)</li>
237
238         <li>Grant access if there is a <a
239         href="#reqgroup"><code>Require group</code></a> directive, and
240         <module>mod_authz_groupfile</module> has been loaded with the 
241         <directive module="mod_authz_groupfile">AuthGroupFile</directive> 
242         directive set.</li>
243     
244         <li>others...</li>
245      </ul>
246
247
248     <p><module>mod_authnz_ldap</module> uses the following directives during the
249     compare phase:</p>
250
251     <table>
252       <columnspec><column width=".4"/><column width=".6"/></columnspec>
253       <tr>
254         <td><directive module="mod_authnz_ldap">AuthLDAPURL</directive> </td>
255
256         <td>The attribute specified in the
257         URL is used in compare operations for the <code>Require
258         ldap-user</code> operation.</td>
259       </tr>
260
261       <tr>
262         <td><directive
263         module="mod_authnz_ldap">AuthLDAPCompareDNOnServer</directive></td>
264
265         <td>Determines the behavior of the
266         <code>Require ldap-dn</code> directive.</td>
267       </tr>
268
269       <tr>
270         <td><directive
271         module="mod_authnz_ldap">AuthLDAPGroupAttribute</directive></td>
272
273         <td>Determines the attribute to
274         use for comparisons in the <code>Require ldap-group</code>
275         directive.</td>
276       </tr>
277
278       <tr>
279         <td><directive
280         module="mod_authnz_ldap">AuthLDAPGroupAttributeIsDN</directive></td>
281
282         <td>Specifies whether to use the
283         user DN or the username when doing comparisons for the
284         <code>Require ldap-group</code> directive.</td>
285       </tr>
286
287       <tr>
288         <td><directive
289         module="mod_authnz_ldap">AuthLDAPMaxSubGroupDepth</directive></td>
290
291         <td>Determines the maximum depth of sub-groups that will be evaluated
292         during comparisons in the <code>Require ldap-group</code> directive.</td>
293       </tr>
294
295       <tr>
296         <td><directive
297         module="mod_authnz_ldap">AuthLDAPSubGroupAttribute</directive></td>
298
299         <td>Determines the attribute to use when obtaining sub-group members
300         of the current group during comparisons in the <code>Require ldap-group</code>
301         directive.</td>
302       </tr>
303
304       <tr>
305         <td><directive
306         module="mod_authnz_ldap">AuthLDAPSubGroupClass</directive></td>
307
308         <td>Specifies the LDAP objectClass values used to identify if queried directory
309         objects really are group objects (as opposed to user objects) during the
310         <code>Require ldap-group</code> directive's sub-group processing.</td>
311       </tr>
312     </table>
313 </section>
314 </section>
315
316 <section id="requiredirectives"><title>The Require Directives</title>
317
318     <p>Apache's <directive module="mod_authz_core">Require</directive>
319     directives are used during the authorization phase to ensure that
320     a user is allowed to access a resource.  mod_authnz_ldap extends the 
321     authorization types with <code>ldap-user</code>, <code>ldap-dn</code>, 
322     <code>ldap-group</code>, <code>ldap-attribute</code> and 
323     <code>ldap-filter</code>.  Other authorization types may also be 
324     used but may require that additional authorization modules be loaded.</p>
325
326 <section id="requser"><title>Require ldap-user</title>
327
328     <p>The <code>Require ldap-user</code> directive specifies what
329     usernames can access the resource. Once
330     <module>mod_authnz_ldap</module> has retrieved a unique DN from the
331     directory, it does an LDAP compare operation using the username
332     specified in the <code>Require ldap-user</code> to see if that username
333     is part of the just-fetched LDAP entry.  Multiple users can be
334     granted access by putting multiple usernames on the line,
335     separated with spaces. If a username has a space in it, then it
336     must be surrounded with double quotes. Multiple users can also be
337     granted access by using multiple <code>Require ldap-user</code>
338     directives, with one user per line. For example, with a <directive
339     module="mod_authnz_ldap">AuthLDAPURL</directive> of
340     <code>ldap://ldap/o=Example?cn</code> (i.e., <code>cn</code> is
341     used for searches), the following Require directives could be used
342     to restrict access:</p>
343 <example>
344 Require ldap-user "Barbara Jenson"<br />
345 Require ldap-user "Fred User"<br />
346 Require ldap-user "Joe Manager"<br />
347 </example>
348
349     <p>Because of the way that <module>mod_authnz_ldap</module> handles this
350     directive, Barbara Jenson could sign on as <em>Barbara
351     Jenson</em>, <em>Babs Jenson</em> or any other <code>cn</code> that
352     she has in her LDAP entry. Only the single <code>Require
353     ldap-user</code> line is needed to support all values of the attribute
354     in the user's entry.</p>
355
356     <p>If the <code>uid</code> attribute was used instead of the
357     <code>cn</code> attribute in the URL above, the above three lines
358     could be condensed to</p>
359 <example>Require ldap-user bjenson fuser jmanager</example>
360 </section>
361
362 <section id="reqgroup"><title>Require ldap-group</title>
363
364     <p>This directive specifies an LDAP group whose members are
365     allowed access. It takes the distinguished name of the LDAP
366     group. Note: Do not surround the group name with quotes.
367     For example, assume that the following entry existed in
368     the LDAP directory:</p>
369 <example>
370 dn: cn=Administrators, o=Example<br />
371 objectClass: groupOfUniqueNames<br />
372 uniqueMember: cn=Barbara Jenson, o=Example<br />
373 uniqueMember: cn=Fred User, o=Example<br />
374 </example>
375
376     <p>The following directive would grant access to both Fred and
377     Barbara:</p>
378 <example>Require ldap-group cn=Administrators, o=Example</example>
379
380     <p>Members can also be found within sub-groups of a specified LDAP group
381     if <directive module="mod_authnz_ldap">AuthLDAPMaxSubGroupDepth</directive>
382     is set to a value greater than 0. For example, assume the following entries
383     exist in the LDAP directory:</p>
384 <example>
385 dn: cn=Employees, o=Example<br />
386 objectClass: groupOfUniqueNames<br />
387 uniqueMember: cn=Managers, o=Example<br />
388 uniqueMember: cn=Administrators, o=Example<br />
389 uniqueMember: cn=Users, o=Example<br />
390 <br />
391 dn: cn=Managers, o=Example<br />
392 objectClass: groupOfUniqueNames<br />
393 uniqueMember: cn=Bob Ellis, o=Example<br />
394 uniqueMember: cn=Tom Jackson, o=Example<br />
395 <br />
396 dn: cn=Administrators, o=Example<br />
397 objectClass: groupOfUniqueNames<br />
398 uniqueMember: cn=Barbara Jenson, o=Example<br />
399 uniqueMember: cn=Fred User, o=Example<br />
400 <br />
401 dn: cn=Users, o=Example<br />
402 objectClass: groupOfUniqueNames<br />
403 uniqueMember: cn=Allan Jefferson, o=Example<br />
404 uniqueMember: cn=Paul Tilley, o=Example<br />
405 uniqueMember: cn=Temporary Employees, o=Example<br />
406 <br />
407 dn: cn=Temporary Employees, o=Example<br />
408 objectClass: groupOfUniqueNames<br />
409 uniqueMember: cn=Jim Swenson, o=Example<br />
410 uniqueMember: cn=Elliot Rhodes, o=Example<br />
411 </example>
412
413     <p>The following directives would allow access for Bob Ellis, Tom Jackson,
414     Barbara Jensen, Fred User, Allan Jefferson, and Paul Tilley but would not
415     allow access for Jim Swenson, or Elliot Rhodes (since they are at a 
416     sub-group depth of 2):</p>
417 <example>
418 Require ldap-group cn=Employees, o-Example<br />
419 AuthLDAPSubGroupDepth 1<br />
420 </example>
421
422     <p>Behavior of this directive is modified by the <directive
423     module="mod_authnz_ldap">AuthLDAPGroupAttribute</directive>, <directive
424     module="mod_authnz_ldap">AuthLDAPGroupAttributeIsDN</directive>, <directive
425     module="mod_authnz_ldap">AuthLDAPMaxSubGroupDepth</directive>, <directive
426     module="mod_authnz_ldap">AuthLDAPSubGroupAttribute</directive>, and <directive
427     module="mod_authnz_ldap">AuthLDAPSubGroupClass</directive>
428     directives.</p>
429 </section>
430
431 <section id="reqdn"><title>Require ldap-dn</title>
432
433     <p>The <code>Require ldap-dn</code> directive allows the administrator
434     to grant access based on distinguished names. It specifies a DN
435     that must match for access to be granted. If the distinguished
436     name that was retrieved from the directory server matches the
437     distinguished name in the <code>Require ldap-dn</code>, then
438     authorization is granted. Note: do not surround the distinguished
439     name with quotes.</p>
440
441     <p>The following directive would grant access to a specific
442     DN:</p>
443 <example>Require ldap-dn cn=Barbara Jenson, o=Example</example>
444
445     <p>Behavior of this directive is modified by the <directive
446     module="mod_authnz_ldap">AuthLDAPCompareDNOnServer</directive>
447     directive.</p>
448 </section>
449
450 <section id="reqattribute"><title>Require ldap-attribute</title>
451
452     <p>The <code>Require ldap-attribute</code> directive allows the
453     administrator to grant access based on attributes of the authenticated
454     user in the LDAP directory.  If the attribute in the directory
455     matches the value given in the configuration, access is granted.</p>
456     
457     <p>The following directive would grant access to anyone with
458     the attribute employeeType = active</p>
459
460     <example>Require ldap-attribute employeeType=active</example>
461
462     <p>Multiple attribute/value pairs can be specified on the same line
463     separated by spaces or they can be specified in multiple 
464     <code>Require ldap-attribute</code> directives. The effect of listing 
465     multiple attribute/values pairs is an OR operation. Access will be 
466     granted if any of the listed attribute values match the value of the 
467     corresponding attribute in the user object. If the value of the 
468     attribute contains a space, only the value must be within double quotes.</p>
469
470     <p>The following directive would grant access to anyone with
471     the city attribute equal to "San Jose" or status equal to "Active"</p>
472
473     <example>Require ldap-attribute city="San Jose" status=active</example>
474
475 </section>
476
477 <section id="reqfilter"><title>Require ldap-filter</title>
478
479     <p>The <code>Require ldap-filter</code> directive allows the
480     administrator to grant access based on a complex LDAP search filter.
481     If the dn returned by the filter search matches the authenticated user
482     dn, access is granted.</p>
483     
484     <p>The following directive would grant access to anyone having a cell phone
485     and is in the marketing department</p>
486
487     <example>Require ldap-filter &amp;(cell=*)(department=marketing)</example>
488
489     <p>The difference between the <code>Require ldap-filter</code> directive and the 
490     <code>Require ldap-attribute</code> directive is that <code>ldap-filter</code> 
491     performs a search operation on the LDAP directory using the specified search 
492     filter rather than a simple attribute comparison. If a simple attribute 
493     comparison is all that is required, the comparison operation performed by 
494     <code>ldap-attribute</code> will be faster than the search operation 
495     used by <code>ldap-filter</code> especially within a large directory.</p>
496
497 </section>
498
499 </section>
500
501 <section id="examples"><title>Examples</title>
502
503     <ul>
504       <li>
505         Grant access to anyone who exists in the LDAP directory,
506         using their UID for searches. 
507 <example>
508 AuthLDAPURL "ldap://ldap1.example.com:389/ou=People, o=Example?uid?sub?(objectClass=*)"<br />
509 Require valid-user
510 </example>
511       </li>
512
513       <li>
514         The next example is the same as above; but with the fields
515         that have useful defaults omitted. Also, note the use of a
516         redundant LDAP server. 
517 <example>AuthLDAPURL "ldap://ldap1.example.com ldap2.example.com/ou=People, o=Example"<br />
518 Require valid-user
519 </example>
520       </li>
521
522       <li>
523         The next example is similar to the previous one, but it
524         uses the common name instead of the UID. Note that this
525         could be problematical if multiple people in the directory
526         share the same <code>cn</code>, because a search on <code>cn</code>
527         <strong>must</strong> return exactly one entry. That's why
528         this approach is not recommended: it's a better idea to
529         choose an attribute that is guaranteed unique in your
530         directory, such as <code>uid</code>. 
531 <example>
532 AuthLDAPURL "ldap://ldap.example.com/ou=People, o=Example?cn"<br />
533 Require valid-user
534 </example>
535       </li>
536
537       <li>
538         Grant access to anybody in the Administrators group. The
539         users must authenticate using their UID. 
540 <example>
541 AuthLDAPURL ldap://ldap.example.com/o=Example?uid<br />
542 Require ldap-group cn=Administrators, o=Example
543 </example>
544       </li>
545
546       <li>
547         The next example assumes that everyone at Example who
548         carries an alphanumeric pager will have an LDAP attribute
549         of <code>qpagePagerID</code>. The example will grant access
550         only to people (authenticated via their UID) who have
551         alphanumeric pagers: 
552 <example>
553 AuthLDAPURL ldap://ldap.example.com/o=Example?uid??(qpagePagerID=*)<br />
554 Require valid-user
555 </example>
556       </li>
557
558       <li>
559         <p>The next example demonstrates the power of using filters
560         to accomplish complicated administrative requirements.
561         Without filters, it would have been necessary to create a
562         new LDAP group and ensure that the group's members remain
563         synchronized with the pager users. This becomes trivial
564         with filters. The goal is to grant access to anyone who has
565         a pager, plus grant access to Joe Manager, who doesn't
566         have a pager, but does need to access the same
567         resource:</p>
568 <example>
569 AuthLDAPURL ldap://ldap.example.com/o=Example?uid??(|(qpagePagerID=*)(uid=jmanager))<br />
570 Require valid-user
571 </example>
572
573         <p>This last may look confusing at first, so it helps to
574         evaluate what the search filter will look like based on who
575         connects, as shown below.  If
576         Fred User connects as <code>fuser</code>, the filter would look
577         like</p>
578
579         <example>(&amp;(|(qpagePagerID=*)(uid=jmanager))(uid=fuser))</example>
580
581         <p>The above search will only succeed if <em>fuser</em> has a
582         pager. When Joe Manager connects as <em>jmanager</em>, the
583         filter looks like</p>
584
585         <example>(&amp;(|(qpagePagerID=*)(uid=jmanager))(uid=jmanager))</example>
586
587         <p>The above search will succeed whether <em>jmanager</em>
588         has a pager or not.</p>
589       </li>
590     </ul>
591 </section>
592
593 <section id="usingtls"><title>Using TLS</title>
594
595     <p>To use TLS, see the <module>mod_ldap</module> directives <directive
596     module="mod_ldap">LDAPTrustedClientCert</directive>, <directive
597     module="mod_ldap">LDAPTrustedGlobalCert</directive> and <directive
598     module="mod_ldap">LDAPTrustedMode</directive>.</p>
599
600     <p>An optional second parameter can be added to the 
601     <directive module="mod_authnz_ldap">AuthLDAPURL</directive> to override
602     the default connection type set by <directive module="mod_ldap">LDAPTrustedMode</directive>.
603     This will allow the connection established by an <em>ldap://</em> Url 
604     to be upgraded to a secure connection on the same port.</p>
605 </section>
606
607 <section id="usingssl"><title>Using SSL</title>
608
609     <p>To use SSL, see the <module>mod_ldap</module> directives <directive
610     module="mod_ldap">LDAPTrustedClientCert</directive>, <directive
611     module="mod_ldap">LDAPTrustedGlobalCert</directive> and <directive
612     module="mod_ldap">LDAPTrustedMode</directive>.</p>
613
614     <p>To specify a secure LDAP server, use <em>ldaps://</em> in the
615     <directive module="mod_authnz_ldap">AuthLDAPURL</directive>
616     directive, instead of <em>ldap://</em>.</p>
617 </section>
618
619 <section id="exposed"><title>Exposing Login Information</title>
620
621     <p>when this module performs <em>authentication</em>, ldap attributes specified
622     in the <directive module="mod_authnz_ldap">authldapurl</directive> 
623     directive are placed in environment variables with the prefix "AUTHENTICATE_".</p>
624
625     <p>when this module performs <em>authorization</em>, ldap attributes specified
626     in the <directive module="mod_authnz_ldap">authldapurl</directive> 
627     directive are placed in environment variables with the prefix "AUTHORIZE_".</p>
628
629     <p>If the attribute field contains the username, common name
630     and telephone number of a user, a CGI program will have access to
631     this information without the need to make a second independent LDAP
632     query to gather this additional information.</p>
633
634     <p>This has the potential to dramatically simplify the coding and
635     configuration required in some web applications.</p>
636
637 </section>
638
639 <section id="activedirectory"><title>Using Active Directory</title>
640
641     <p>An Active Directory installation may support multiple domains at the
642     same time. To distinguish users between domains, an identifier called
643     a User Principle Name (UPN) can be added to a user's entry in the
644     directory. This UPN usually takes the form of the user's account
645     name, followed by the domain components of the particular domain,
646     for example <em>somebody@nz.example.com</em>.</p>
647
648     <p>You may wish to configure the <module>mod_authnz_ldap</module>
649     module to authenticate users present in any of the domains making up
650     the Active Directory forest. In this way both
651     <em>somebody@nz.example.com</em> and <em>someone@au.example.com</em>
652     can be authenticated using the same query at the same time.</p>
653
654     <p>To make this practical, Active Directory supports the concept of
655     a Global Catalog. This Global Catalog is a read only copy of selected
656     attributes of all the Active Directory servers within the Active
657     Directory forest. Querying the Global Catalog allows all the domains
658     to be queried in a single query, without the query spanning servers
659     over potentially slow links.</p>
660
661     <p>If enabled, the Global Catalog is an independent directory server
662     that runs on port 3268 (3269 for SSL). To search for a user, do a
663     subtree search for the attribute <em>userPrincipalName</em>, with
664     an empty search root, like so:</p>
665
666 <example>
667 AuthLDAPBindDN apache@example.com<br />
668 AuthLDAPBindPassword password<br />
669 AuthLDAPURL ldap://10.0.0.1:3268/?userPrincipalName?sub
670 </example>
671
672     <p>Users will need to enter their User Principal Name as a login, in
673     the form <em>somebody@nz.example.com</em>.</p>
674
675 </section>
676
677 <section id="frontpage"><title>Using Microsoft
678     FrontPage with mod_authnz_ldap</title>
679
680     <p>Normally, FrontPage uses FrontPage-web-specific user/group
681     files (i.e., the <module>mod_authn_file</module> and
682     <module>mod_authz_groupfile</module> modules) to handle all
683     authentication. Unfortunately, it is not possible to just
684     change to LDAP authentication by adding the proper directives,
685     because it will break the <em>Permissions</em> forms in
686     the FrontPage client, which attempt to modify the standard
687     text-based authorization files.</p>
688
689     <p>Once a FrontPage web has been created, adding LDAP
690     authentication to it is a matter of adding the following
691     directives to <em>every</em> <code>.htaccess</code> file
692     that gets created in the web</p>
693 <example><pre>
694 AuthLDAPURL            "the url"
695 AuthGroupFile <em>mygroupfile</em>
696 Require group <em>mygroupfile</em>
697 </pre></example>
698
699 <section id="howitworks"><title>How It Works</title>
700
701     <p>FrontPage restricts access to a web by adding the <code>Require
702     valid-user</code> directive to the <code>.htaccess</code>
703     files. The <code>Require valid-user</code> directive will succeed for
704     any user who is valid <em>as far as LDAP is
705     concerned</em>. This means that anybody who has an entry in
706     the LDAP directory is considered a valid user, whereas FrontPage
707     considers only those people in the local user file to be
708     valid. By substituting the ldap-group with group file authorization,
709     Apache is allowed to consult the local user file (which is managed by 
710     FrontPage) - instead of LDAP - when handling authorizing the user.</p>
711
712     <p>Once directives have been added as specified above,
713     FrontPage users will be able to perform all management
714     operations from the FrontPage client.</p>
715 </section>
716
717 <section id="fpcaveats"><title>Caveats</title>
718
719     <ul>
720       <li>When choosing the LDAP URL, the attribute to use for
721       authentication should be something that will also be valid
722       for putting into a <module>mod_authn_file</module> user file.
723       The user ID is ideal for this.</li>
724
725       <li>When adding users via FrontPage, FrontPage administrators
726       should choose usernames that already exist in the LDAP
727       directory (for obvious reasons). Also, the password that the
728       administrator enters into the form is ignored, since Apache
729       will actually be authenticating against the password in the
730       LDAP database, and not against the password in the local user
731       file. This could cause confusion for web administrators.</li>
732
733       <!-- XXX is that true? was mod_auth before the aaa change -->
734       <li>Apache must be compiled with <module>mod_auth_basic</module>,
735       <module>mod_authn_file</module> and
736       <module>mod_authz_groupfile</module> in order to
737       use FrontPage support. This is because Apache will still use
738       the <module>mod_authz_groupfile</module> group file for determine 
739       the extent of a user's access to the FrontPage web.</li>
740
741       <li>The directives must be put in the <code>.htaccess</code>
742       files. Attempting to put them inside <directive module="core"
743       type="section">Location</directive> or <directive module="core"
744       type="section">Directory</directive> directives won't work. This
745       is because <module>mod_authnz_ldap</module> has to be able to grab
746       the <directive module="mod_authn_file">AuthGroupFile</directive>
747       directive that is found in FrontPage <code>.htaccess</code>
748       files so that it knows where to look for the valid user list. If
749       the <module>mod_authnz_ldap</module> directives aren't in the same
750       <code>.htaccess</code> file as the FrontPage directives, then
751       the hack won't work, because <module>mod_authnz_ldap</module> will
752       never get a chance to process the <code>.htaccess</code> file,
753       and won't be able to find the FrontPage-managed user file.</li>
754     </ul>
755 </section>
756 </section>
757
758 <directivesynopsis>
759 <name>AuthLDAPAuthorizePrefix</name>
760 <description>Specifies the prefix for environment variables set during
761 authorization</description>
762 <syntax>AuthLDAPAuthorizePrefix <em>prefix</em></syntax>
763 <default>AuthLDAPAuthorizePrefix AUTHORIZE_</default>
764 <contextlist><context>directory</context><context>.htaccess</context>
765 </contextlist>
766 <override>AuthConfig</override>
767 <compatibility>Available in version 2.3.6 and later</compatibility>
768 <usage>
769     <p>This directive allows you to override the prefix used for environment
770     variables set during LDAP authorization.  If <em>AUTHENTICATE_</em> is
771     specified, consumers of these environment variables see the same information
772     whether LDAP has performed authentication, authorization, or both.</p>
773
774     <note><title>Note</title>
775     No authorization variables are set when a user is authorized on the basis of 
776     <code>Require valid-user</code>.
777     </note>
778 </usage>
779 </directivesynopsis>
780
781
782 <directivesynopsis>
783 <name>AuthLDAPBindAuthoritative</name>
784 <description>Determines if other authentication providers are used when a user can be mapped to a DN but the server cannot successfully bind with the user's credentials.</description>
785 <syntax>AuthLDAPBindAuthoritative<em>off|on</em></syntax>
786 <default>AuthLDAPBindAuthoritative on</default>
787 <contextlist><context>directory</context><context>.htaccess</context>
788 </contextlist>
789 <override>AuthConfig</override>
790 <usage>
791     <p>By default, subsequent authentication providers are only queried if a 
792     user cannot be mapped to a DN, but not if the user can be mapped to a DN and their
793     password cannot be verified with an LDAP bind.  
794     If <directive module="mod_authnz_ldap">AuthLDAPBindAuthoritative</directive> 
795     is set to <em>off</em>, other configured authentication modules will have 
796     a chance to validate the user if the LDAP bind (with the current user's credentials) 
797     fails for any reason.</p>
798     <p> This allows users present in both LDAP and 
799     <directive module="mod_authn_file">AuthUserFile</directive> to authenticate
800     when the LDAP server is available but the user's account is locked or password
801     is otherwise unusable.</p>
802 </usage>
803 <seealso><directive module="mod_authn_file">AuthUserFile</directive></seealso>
804 <seealso><directive module="mod_auth_basic">AuthBasicProvider</directive></seealso>
805 </directivesynopsis>
806
807 <directivesynopsis>
808 <name>AuthLDAPInitialBindAsUser</name>
809 <description>Determines if the server does the initial DN lookup using the basic authentication users'
810 own username, instead of anonymously or with hard-coded credentials for the server</description>
811 <syntax>AuthLDAPInitialBindAsUser <em>off|on</em></syntax>
812 <default>AuthLDAPInitialBindAsUser off</default>
813 <contextlist><context>directory</context><context>.htaccess</context>
814 </contextlist>
815 <override>AuthConfig</override>
816 <compatibility>Available in version 2.3.6 and later</compatibility>
817 <usage>
818     <p>By default, the server either anonymously, or with a dedicated user and
819      password, converts the basic authentication username into an LDAP
820      distinguished name (DN).  This directive forces the server to use the verbatim username
821      and password provided by the incoming user to perform the initial DN
822      search.</p>
823  
824      <p> If the verbatim username can't directly bind, but needs some
825      cosmetic transformation, see <directive module="mod_authnz_ldap">
826      AuthLDAPInitialBindPattern</directive>.</p>
827    
828      <p> This directive should only be used when your LDAP server doesn't 
829          accept anonymous searches and you cannot use a dedicated 
830          <directive module="mod_authnz_ldap">AuthLDAPBindDN</directive>.
831      </p>
832
833      <note><title>Not available with authorization-only</title>
834          This directive can only be used if this module authenticates the user, and
835          has no effect when this module is used exclusively for authorization.
836      </note>
837 </usage>
838 <seealso><directive module="mod_authnnz_ldap">AuthLDAPInitialBindPattern</directive></seealso>
839 <seealso><directive module="mod_authnnz_ldap">AuthLDAPBindDN</directive></seealso>
840 <seealso><directive module="mod_authnz_ldap">AuthLDAPCompareAsUser</directive></seealso>
841 <seealso><directive module="mod_authnz_ldap">AuthLDAPSearchAsUser</directive></seealso>
842 </directivesynopsis>
843
844 <directivesynopsis>
845 <name>AuthLDAPInitialBindPattern</name>
846 <description>Specifies the transformation of the basic authentication username to be used when binding to the LDAP server
847 to perform a DN lookup</description>
848 <syntax>AuthLDAPInitialBindPattern<em><var>regex</var> <var>substitution</var></em></syntax>
849 <default>AuthLDAPInitialBindPattern (.*) $1 (remote username used verbatim)</default>
850 <contextlist><context>directory</context><context>.htaccess</context>
851 </contextlist>
852 <override>AuthConfig</override>
853 <compatibility>Available in version 2.3.6 and later</compatibility>
854 <usage>
855     <p>If <directive module="mod_authnz_ldap">AuthLDAPInitialBindAsUser</directive> is set to
856        <em>ON</em>, the basic authentication username will be transformed according to the
857        regular expression and substituion arguments.</p>
858
859     <p> The regular expression argument is compared against the current basic authentication username.
860         The substitution argument may contain backreferences, but has no other variable interpolation.</p>
861      
862     <p> This directive should only be used when your LDAP server doesn't 
863         accept anonymous searches and you cannot use a dedicated 
864         <directive module="mod_authnz_ldap">AuthLDAPBindDN</directive>.
865     </p>
866
867     <example> AuthLDAPInitialBindPattern (.+) $1@example.com </example>
868     <example> AuthLDAPInitialBindPattern (.+) cn=$1,dc=example,dc=com</example>
869
870     <note><title>Not available with authorization-only</title>
871         This directive can only be used if this module authenticates the user, and
872         has no effect when this module is used exclusively for authorization.
873     </note>
874     <note><title>debugging</title>
875         The substituted DN is recorded in the environment variable 
876         <em>LDAP_BINDASUSER</em>.  If the regular expression does not match the input, 
877         the verbatim username is used.
878     </note>
879 </usage>
880 <seealso><directive module="mod_authnnz_ldap">AuthLDAPInitialBindAsUser</directive></seealso>
881 <seealso><directive module="mod_authnnz_ldap">AuthLDAPBindDN</directive></seealso>
882 </directivesynopsis>
883
884 <directivesynopsis>
885 <name>AuthLDAPBindDN</name>
886 <description>Optional DN to use in binding to the LDAP server</description>
887 <syntax>AuthLDAPBindDN <em>distinguished-name</em></syntax>
888 <contextlist><context>directory</context><context>.htaccess</context>
889 </contextlist>
890 <override>AuthConfig</override>
891
892 <usage>
893     <p>An optional DN used to bind to the server when searching for
894     entries. If not provided, <module>mod_authnz_ldap</module> will use
895     an anonymous bind.</p>
896 </usage>
897 </directivesynopsis>
898
899 <directivesynopsis>
900 <name>AuthLDAPBindPassword</name>
901 <description>Password used in conjuction with the bind DN</description>
902 <syntax>AuthLDAPBindPassword <em>password</em></syntax>
903 <contextlist><context>directory</context><context>.htaccess</context>
904 </contextlist>
905 <override>AuthConfig</override>
906
907 <usage>
908     <p>A bind password to use in conjunction with the bind DN. Note
909     that the bind password is probably sensitive data, and should be
910     properly protected. You should only use the <directive
911     module="mod_authnz_ldap">AuthLDAPBindDN</directive> and <directive
912     module="mod_authnz_ldap">AuthLDAPBindPassword</directive> if you
913     absolutely need them to search the directory.</p> 
914 </usage>
915 </directivesynopsis>
916
917 <directivesynopsis>
918 <name>AuthLDAPCharsetConfig</name>
919 <description>Language to charset conversion configuration file</description>
920 <syntax>AuthLDAPCharsetConfig <em>file-path</em></syntax>
921 <contextlist><context>server config</context>
922 </contextlist>
923
924 <usage>
925     <p>The <directive>AuthLDAPCharsetConfig</directive> directive sets the location
926     of the language to charset conversion configuration file. <var>File-path</var> is relative
927     to the <directive module="core">ServerRoot</directive>. This file specifies
928     the list of language extensions to character sets.
929     Most administrators use the provided <code>charset.conv</code>
930     file, which associates common language extensions to character sets.</p>
931
932     <p>The file contains lines in the following format:</p>
933
934     <example>
935       <var>Language-Extension</var> <var>charset</var> [<var>Language-String</var>] ...
936     </example>
937
938     <p>The case of the extension does not matter. Blank lines, and lines
939     beginning with a hash character (<code>#</code>) are ignored.</p>
940 </usage>
941 </directivesynopsis>
942
943 <directivesynopsis>
944 <name>AuthLDAPCompareAsUser</name>
945 <description>Use the authenticated user's credentials to perform authorization comparisons</description>
946 <syntax>AuthLDAPCompareAsUser on|off</syntax>
947 <default>AuthLDAPCompareAsUser off</default>
948 <contextlist><context>directory</context><context>.htaccess</context>
949 </contextlist>
950 <override>AuthConfig</override>
951 <compatibility>Available in version 2.3.6 and later</compatibility>
952
953 <usage>
954     <p>When set, and <module>mod_authnz_ldap</module> has authenticated the
955     user, LDAP comparisons for authorization use the queried distinguished name (DN)
956     and HTTP basic authentication password of the authenticated user instead of 
957     the servers configured credentials.</p>
958
959     <p> The <em>ldap-attribute</em>, <em>ldap-user</em>, and <em>ldap-group</em> (single-level only) 
960     authorization checks use comparisons.</p>
961
962     <p>This directive only has effect on the comparisons performed during
963     nested group processing when <directive module="mod_authnz_ldap">
964     AuthLDAPSearchAsUser</directive> is also enabled.</p>
965     
966     <p> This directive should only be used when your LDAP server doesn't
967         accept anonymous comparisons and you cannot use a dedicated
968         <directive module="mod_authnz_ldap">AuthLDAPBindDN</directive>.
969     </p>
970 </usage>
971 <seealso><directive module="mod_authnz_ldap">AuthLDAPInitialBindAsUser</directive></seealso>
972 <seealso><directive module="mod_authnz_ldap">AuthLDAPSearchAsUser</directive></seealso>
973 </directivesynopsis>
974
975 <directivesynopsis>
976 <name>AuthLDAPCompareDNOnServer</name>
977 <description>Use the LDAP server to compare the DNs</description>
978 <syntax>AuthLDAPCompareDNOnServer on|off</syntax>
979 <default>AuthLDAPCompareDNOnServer on</default>
980 <contextlist><context>directory</context><context>.htaccess</context>
981 </contextlist>
982 <override>AuthConfig</override>
983
984 <usage>
985     <p>When set, <module>mod_authnz_ldap</module> will use the LDAP
986     server to compare the DNs. This is the only foolproof way to
987     compare DNs.  <module>mod_authnz_ldap</module> will search the
988     directory for the DN specified with the <a
989     href="#reqdn"><code>Require dn</code></a> directive, then,
990     retrieve the DN and compare it with the DN retrieved from the user
991     entry. If this directive is not set,
992     <module>mod_authnz_ldap</module> simply does a string comparison. It
993     is possible to get false negatives with this approach, but it is
994     much faster. Note the <module>mod_ldap</module> cache can speed up
995     DN comparison in most situations.</p>
996 </usage>
997 </directivesynopsis>
998
999 <directivesynopsis>
1000 <name>AuthLDAPDereferenceAliases</name>
1001 <description>When will the module de-reference aliases</description>
1002 <syntax>AuthLDAPDereferenceAliases never|searching|finding|always</syntax>
1003 <default>AuthLDAPDereferenceAliases always</default>
1004 <contextlist><context>directory</context><context>.htaccess</context>
1005 </contextlist>
1006 <override>AuthConfig</override>
1007
1008 <usage>
1009     <p>This directive specifies when <module>mod_authnz_ldap</module> will
1010     de-reference aliases during LDAP operations. The default is
1011     <code>always</code>.</p>
1012 </usage>
1013 </directivesynopsis>
1014
1015 <directivesynopsis>
1016 <name>AuthLDAPGroupAttribute</name>
1017 <description>LDAP attributes used to identify the user members of
1018 groups.</description>
1019 <syntax>AuthLDAPGroupAttribute <em>attribute</em></syntax>
1020 <default>AuthLDAPGroupAttribute member uniquemember</default>
1021 <contextlist><context>directory</context><context>.htaccess</context>
1022 </contextlist>
1023 <override>AuthConfig</override>
1024
1025 <usage>
1026     <p>This directive specifies which LDAP attributes are used to
1027     check for user members within groups. Multiple attributes can be used
1028     by specifying this directive multiple times. If not specified,
1029     then <module>mod_authnz_ldap</module> uses the <code>member</code> and
1030     <code>uniquemember</code> attributes.</p>
1031 </usage>
1032 </directivesynopsis>
1033
1034 <directivesynopsis>
1035 <name>AuthLDAPGroupAttributeIsDN</name>
1036 <description>Use the DN of the client username when checking for
1037 group membership</description>
1038 <syntax>AuthLDAPGroupAttributeIsDN on|off</syntax>
1039 <default>AuthLDAPGroupAttributeIsDN on</default>
1040 <contextlist><context>directory</context><context>.htaccess</context>
1041 </contextlist>
1042 <override>AuthConfig</override>
1043
1044 <usage>
1045     <p>When set <code>on</code>, this directive says to use the
1046     distinguished name of the client username when checking for group
1047     membership.  Otherwise, the username will be used. For example,
1048     assume that the client sent the username <code>bjenson</code>,
1049     which corresponds to the LDAP DN <code>cn=Babs Jenson,
1050     o=Example</code>. If this directive is set,
1051     <module>mod_authnz_ldap</module> will check if the group has
1052     <code>cn=Babs Jenson, o=Example</code> as a member. If this
1053     directive is not set, then <module>mod_authnz_ldap</module> will
1054     check if the group has <code>bjenson</code> as a member.</p>
1055 </usage>
1056 </directivesynopsis>
1057
1058 <directivesynopsis>
1059 <name>AuthLDAPMaxSubGroupDepth</name>
1060 <description>Specifies the maximum sub-group nesting depth that will be
1061 evaluated before the user search is discontinued.</description>
1062 <syntax>AuthLDAPMaxSubGroupDepth <var>Number</var></syntax>
1063 <default>AuthLDAPMaxSubGroupDepth 10</default>
1064 <contextlist><context>directory</context><context>.htaccess</context>
1065 </contextlist>
1066 <override>AuthConfig</override>
1067
1068 <usage>
1069    <p>When this directive is set to a non-zero value <code>X</code>
1070    combined with use of the <code>Require ldap-group someGroupDN</code>
1071    directive, the provided user credentials will be searched for
1072    as a member of the <code>someGroupDN</code> directory object or of
1073    any group member of the current group up to the maximum nesting
1074    level <code>X</code> specified by this directive.</p>
1075    <p>See the <a href="#reqgroup"><code>Require ldap-group</code></a>
1076    section for a more detailed example.</p>
1077 </usage>
1078 </directivesynopsis>
1079
1080 <directivesynopsis>
1081 <name>AuthLDAPRemoteUserAttribute</name>
1082 <description>Use the value of the attribute returned during the user
1083 query to set the REMOTE_USER environment variable</description>
1084 <syntax>AuthLDAPRemoteUserAttribute uid</syntax>
1085 <default>none</default>
1086 <contextlist><context>directory</context><context>.htaccess</context>
1087 </contextlist>
1088 <override>AuthConfig</override> 
1089       
1090 <usage>
1091     <p>If this directive is set, the value of the 
1092     <code>REMOTE_USER</code> environment variable will be set to the
1093     value of the attribute specified. Make sure that this attribute is
1094     included in the list of attributes in the AuthLDAPUrl definition,
1095     otherwise this directive will have no effect. This directive, if
1096     present, takes precedence over AuthLDAPRemoteUserIsDN. This
1097     directive is useful should you want people to log into a website
1098     using an email address, but a backend application expects the
1099     username as a userid.</p>
1100 </usage>
1101 </directivesynopsis>
1102
1103 <directivesynopsis>
1104 <name>AuthLDAPRemoteUserIsDN</name>
1105 <description>Use the DN of the client username to set the REMOTE_USER
1106 environment variable</description>
1107 <syntax>AuthLDAPRemoteUserIsDN on|off</syntax>
1108 <default>AuthLDAPRemoteUserIsDN off</default>
1109 <contextlist><context>directory</context><context>.htaccess</context>
1110 </contextlist>
1111 <override>AuthConfig</override>
1112
1113 <usage>
1114     <p>If this directive is set to on, the value of the
1115     <code>REMOTE_USER</code> environment variable will be set to the full
1116     distinguished name of the authenticated user, rather than just
1117     the username that was passed by the client. It is turned off by
1118     default.</p>
1119 </usage>
1120 </directivesynopsis>
1121
1122 <directivesynopsis>
1123 <name>AuthLDAPSearchAsUser</name>
1124 <description>Use the authenticated user's credentials to perform authorization searches</description>
1125 <syntax>AuthLDAPSearchAsUser on|off</syntax>
1126 <default>AuthLDAPSearchAsUser off</default>
1127 <contextlist><context>directory</context><context>.htaccess</context>
1128 </contextlist>
1129 <override>AuthConfig</override>
1130 <compatibility>Available in version 2.3.6 and later</compatibility>
1131
1132 <usage>
1133     <p>When set, and <module>mod_authnz_ldap</module> has authenticated the
1134     user, LDAP searches for authorization use the queried distinguished name (DN)
1135     and HTTP basic authentication password of the authenticated user instead of 
1136     the servers configured credentials.</p>
1137
1138     <p> The <em>ldap-filter</em> and <em>ldap-dn</em> authorization 
1139     checks use searches.</p>
1140
1141     <p>This directive only has effect on the comparisons performed during
1142     nested group processing when <directive module="mod_authnz_ldap">
1143     AuthLDAPCompareAsUser</directive> is also enabled.</p>
1144
1145     <p> This directive should only be used when your LDAP server doesn't
1146         accept anonymous searches and you cannot use a dedicated
1147         <directive module="mod_authnz_ldap">AuthLDAPBindDN</directive>.
1148     </p>
1149 </usage>
1150 <seealso><directive module="mod_authnz_ldap">AuthLDAPInitialBindAsUser</directive></seealso>
1151 <seealso><directive module="mod_authnz_ldap">AuthLDAPCompareAsUser</directive></seealso>
1152 </directivesynopsis>
1153
1154 <directivesynopsis>
1155 <name>AuthLDAPSubGroupAttribute</name>
1156 <description>Specifies the attribute labels, one value per
1157 directive line, used to distinguish the members of the current group that
1158 are groups.</description>
1159 <syntax>AuthLDAPSubGroupAttribute <em>attribute</em></syntax>
1160 <default>AuthLDAPSubgroupAttribute member uniquemember</default>
1161 <contextlist><context>directory</context><context>.htaccess</context>
1162 </contextlist>
1163 <override>AuthConfig</override>
1164
1165 <usage>
1166     <p>An LDAP group object may contain members that are users and
1167     members that are groups (called nested or sub groups). The
1168     <code>AuthLDAPSubGroupAttribute</code> directive identifies the
1169     labels of group members and the <code>AuthLDAPGroupAttribute</code>
1170     directive identifies the labels of the user members. Multiple
1171     attributes can be used by specifying this directive multiple times.
1172     If not specified, then <module>mod_authnz_ldap</module> uses the
1173     <code>member</code> and <code>uniqueMember</code> attributes.</p>
1174 </usage>
1175 </directivesynopsis>
1176
1177 <directivesynopsis>
1178 <name>AuthLDAPSubGroupClass</name>
1179 <description>Specifies which LDAP objectClass values identify directory
1180 objects that are groups during sub-group processing.</description>
1181 <syntax>AuthLDAPSubGroupClass <em>LdapObjectClass</em></syntax>
1182 <default>AuthLDAPSubGroupClass groupOfNames groupOfUniqueNames</default>
1183 <contextlist><context>directory</context><context>.htaccess</context>
1184 </contextlist>
1185 <override>AuthConfig</override>
1186
1187 <usage>
1188     <p>An LDAP group object may contain members that are users and
1189     members that are groups (called nested or sub groups). The
1190     <code>AuthLDAPSubGroupAttribute</code> directive identifies the
1191     labels of members that may be sub-groups of the current group
1192     (as opposed to user members). The <code>AuthLDAPSubGroupClass</code>
1193     directive specifies the LDAP objectClass values used in verifying that
1194     these potential sub-groups are in fact group objects. Verified sub-groups
1195     can then be searched for more user or sub-group members. Multiple
1196     attributes can be used by specifying this directive multiple times.
1197     If not specified, then <module>mod_authnz_ldap</module> uses the
1198     <code>groupOfNames</code> and <code>groupOfUniqueNames</code> values.</p>
1199 </usage>
1200 </directivesynopsis>
1201
1202 <directivesynopsis>
1203 <name>AuthLDAPUrl</name>
1204 <description>URL specifying the LDAP search parameters</description>
1205 <syntax>AuthLDAPUrl <em>url [NONE|SSL|TLS|STARTTLS]</em></syntax>
1206 <contextlist><context>directory</context><context>.htaccess</context>
1207 </contextlist>
1208 <override>AuthConfig</override>
1209
1210 <usage>
1211     <p>An RFC 2255 URL which specifies the LDAP search parameters
1212     to use. The syntax of the URL is</p>
1213 <example>ldap://host:port/basedn?attribute?scope?filter</example>
1214     <p>If you want to specify more than one LDAP URL that Apache should try in turn, the syntax is:</p>
1215 <example>AuthLDAPUrl "ldap://ldap1.example.com ldap2.example.com/dc=..."</example>
1216 <p><em><strong>Caveat: </strong>If you specify multiple servers, you need to enclose the entire URL string in quotes; 
1217 otherwise you will get an error: "AuthLDAPURL takes one argument, URL to define LDAP connection.." </em> 
1218 You can of course use search parameters on each of these.</p>
1219
1220 <dl>
1221 <dt>ldap</dt>
1222
1223         <dd>For regular ldap, use the
1224         string <code>ldap</code>. For secure LDAP, use <code>ldaps</code>
1225         instead. Secure LDAP is only available if Apache was linked
1226         to an LDAP library with SSL support.</dd>
1227
1228 <dt>host:port</dt>
1229
1230         <dd>
1231           <p>The name/port of the ldap server (defaults to
1232           <code>localhost:389</code> for <code>ldap</code>, and
1233           <code>localhost:636</code> for <code>ldaps</code>). To
1234           specify multiple, redundant LDAP servers, just list all
1235           servers, separated by spaces. <module>mod_authnz_ldap</module>
1236           will try connecting to each server in turn, until it makes a
1237           successful connection. If multiple ldap servers are specified, 
1238           then entire LDAP URL must be encapsulated in double quotes.</p>
1239
1240           <p>Once a connection has been made to a server, that
1241           connection remains active for the life of the
1242           <program>httpd</program> process, or until the LDAP server goes
1243           down.</p>
1244
1245           <p>If the LDAP server goes down and breaks an existing
1246           connection, <module>mod_authnz_ldap</module> will attempt to
1247           re-connect, starting with the primary server, and trying
1248           each redundant server in turn. Note that this is different
1249           than a true round-robin search.</p>
1250         </dd>
1251
1252 <dt>basedn</dt>
1253
1254         <dd>The DN of the branch of the
1255         directory where all searches should start from. At the very
1256         least, this must be the top of your directory tree, but
1257         could also specify a subtree in the directory.</dd>
1258
1259 <dt>attribute</dt>
1260
1261         <dd>The attribute to search for.
1262         Although RFC 2255 allows a comma-separated list of
1263         attributes, only the first attribute will be used, no
1264         matter how many are provided. If no attributes are
1265         provided, the default is to use <code>uid</code>. It's a good
1266         idea to choose an attribute that will be unique across all
1267         entries in the subtree you will be using.  All attributes
1268         listed will be put into the environment with an AUTHENTICATE_ prefix
1269         for use by other modules.</dd>
1270
1271 <dt>scope</dt>
1272
1273         <dd>The scope of the search. Can be either <code>one</code> or
1274         <code>sub</code>. Note that a scope of <code>base</code> is
1275         also supported by RFC 2255, but is not supported by this
1276         module. If the scope is not provided, or if <code>base</code> scope
1277         is specified, the default is to use a scope of
1278         <code>sub</code>.</dd>
1279
1280 <dt>filter</dt>
1281
1282         <dd>A valid LDAP search filter. If
1283         not provided, defaults to <code>(objectClass=*)</code>, which
1284         will search for all objects in the tree. Filters are
1285         limited to approximately 8000 characters (the definition of
1286         <code>MAX_STRING_LEN</code> in the Apache source code). This
1287         should be more than sufficient for any application.</dd>
1288 </dl>
1289
1290     <p>When doing searches, the attribute, filter and username passed
1291     by the HTTP client are combined to create a search filter that
1292     looks like
1293     <code>(&amp;(<em>filter</em>)(<em>attribute</em>=<em>username</em>))</code>.</p>
1294
1295     <p>For example, consider an URL of
1296     <code>ldap://ldap.example.com/o=Example?cn?sub?(posixid=*)</code>. When
1297     a client attempts to connect using a username of <code>Babs
1298     Jenson</code>, the resulting search filter will be
1299     <code>(&amp;(posixid=*)(cn=Babs Jenson))</code>.</p>
1300
1301     <p>An optional parameter can be added to allow the LDAP Url to override 
1302     the connection type.  This parameter can be one of the following:</p>
1303
1304 <dl>
1305     <dt>NONE</dt>
1306         <dd>Establish an unsecure connection on the default LDAP port. This
1307         is the same as <code>ldap://</code> on port 389.</dd>
1308     <dt>SSL</dt>
1309         <dd>Establish a secure connection on the default secure LDAP port.
1310         This is the same as <code>ldaps://</code></dd>
1311     <dt>TLS | STARTTLS</dt>
1312         <dd>Establish an upgraded secure connection on the default LDAP port.
1313         This connection will be initiated on port 389 by default and then 
1314         upgraded to a secure connection on the same port.</dd>
1315 </dl>
1316
1317     <p>See above for examples of <directive
1318     module="mod_authnz_ldap">AuthLDAPURL</directive> URLs.</p>
1319 </usage>
1320 </directivesynopsis>
1321
1322 </modulesynopsis>