home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / apache_2.2.8-win32-x86-no_ssl.msi / Data1.cab / _CA6BBFCADABF2C5BBD0675F7B311E219 < prev    next >
Extensible Markup Language  |  2007-11-14  |  57KB  |  987 lines

  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_authnz_ldap - 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>
  13. <body>
  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.2</p>
  17. <img alt="" src="../images/feather.gif" /></div>
  18. <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
  19. <div id="path">
  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.2</a> > <a href="./">Modules</a></div>
  21. <div id="page-content">
  22. <div id="preamble"><h1>Apache Module mod_authnz_ldap</h1>
  23. <div class="toplang">
  24. <p><span>Available Languages: </span><a href="../en/mod/mod_authnz_ldap.html" title="English"> en </a></p>
  25. </div>
  26. <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Allows an LDAP directory to be used to store the database
  27. for HTTP Basic authentication.</td></tr>
  28. <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  29. <tr><th><a href="module-dict.html#ModuleIdentifier">ModuleáIdentifier:</a></th><td>authnz_ldap_module</td></tr>
  30. <tr><th><a href="module-dict.html#SourceFile">SourceáFile:</a></th><td>mod_authnz_ldap.c</td></tr>
  31. <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.1 and later</td></tr></table>
  32. <h3>Summary</h3>
  33.  
  34.     <p>This module provides authentication front-ends such as
  35.     <code class="module"><a href="../mod/mod_auth_basic.html">mod_auth_basic</a></code> to authenticate users through 
  36.     an ldap directory.</p>
  37.     
  38.     <p><code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> supports the following features:</p>
  39.  
  40.     <ul>
  41.       <li>Known to support the <a href="http://www.openldap.org/">OpenLDAP SDK</a> (both 1.x
  42.       and 2.x), <a href="http://developer.novell.com/ndk/cldap.htm">
  43.       Novell LDAP SDK</a> and the <a href="http://www.iplanet.com/downloads/developer/">iPlanet
  44.       (Netscape)</a> SDK.</li>
  45.  
  46.       <li>Complex authorization policies can be implemented by
  47.       representing the policy with LDAP filters.</li>
  48.  
  49.       <li>Uses extensive caching of LDAP operations via <a href="mod_ldap.html">mod_ldap</a>.</li>
  50.  
  51.       <li>Support for LDAP over SSL (requires the Netscape SDK) or
  52.       TLS (requires the OpenLDAP 2.x SDK or Novell LDAP SDK).</li>
  53.     </ul>
  54.  
  55.     <p>When using <code class="module"><a href="../mod/mod_auth_basic.html">mod_auth_basic</a></code>, this module is invoked
  56.     via the <code class="directive"><a href="../mod/mod_auth_basic.html#authbasicprovider">AuthBasicProvider</a></code>
  57.     directive with the <code>ldap</code> value.</p>
  58. </div>
  59. <div id="quickview"><h3 class="directives">Directives</h3>
  60. <ul id="toc">
  61. <li><img alt="" src="../images/down.gif" /> <a href="#authldapbinddn">AuthLDAPBindDN</a></li>
  62. <li><img alt="" src="../images/down.gif" /> <a href="#authldapbindpassword">AuthLDAPBindPassword</a></li>
  63. <li><img alt="" src="../images/down.gif" /> <a href="#authldapcharsetconfig">AuthLDAPCharsetConfig</a></li>
  64. <li><img alt="" src="../images/down.gif" /> <a href="#authldapcomparednonserver">AuthLDAPCompareDNOnServer</a></li>
  65. <li><img alt="" src="../images/down.gif" /> <a href="#authldapdereferencealiases">AuthLDAPDereferenceAliases</a></li>
  66. <li><img alt="" src="../images/down.gif" /> <a href="#authldapgroupattribute">AuthLDAPGroupAttribute</a></li>
  67. <li><img alt="" src="../images/down.gif" /> <a href="#authldapgroupattributeisdn">AuthLDAPGroupAttributeIsDN</a></li>
  68. <li><img alt="" src="../images/down.gif" /> <a href="#authldapremoteuserattribute">AuthLDAPRemoteUserAttribute</a></li>
  69. <li><img alt="" src="../images/down.gif" /> <a href="#authldapremoteuserisdn">AuthLDAPRemoteUserIsDN</a></li>
  70. <li><img alt="" src="../images/down.gif" /> <a href="#authldapurl">AuthLDAPUrl</a></li>
  71. <li><img alt="" src="../images/down.gif" /> <a href="#authzldapauthoritative">AuthzLDAPAuthoritative</a></li>
  72. </ul>
  73. <h3>Topics</h3>
  74. <ul id="topics">
  75. <li><img alt="" src="../images/down.gif" /> <a href="#contents">Contents</a></li>
  76. <li><img alt="" src="../images/down.gif" /> <a href="#operation">Operation</a></li>
  77. <li><img alt="" src="../images/down.gif" /> <a href="#requiredirectives">The Require Directives</a></li>
  78. <li><img alt="" src="../images/down.gif" /> <a href="#examples">Examples</a></li>
  79. <li><img alt="" src="../images/down.gif" /> <a href="#usingtls">Using TLS</a></li>
  80. <li><img alt="" src="../images/down.gif" /> <a href="#usingssl">Using SSL</a></li>
  81. <li><img alt="" src="../images/down.gif" /> <a href="#exposed">Exposing Login Information</a></li>
  82. <li><img alt="" src="../images/down.gif" /> <a href="#frontpage">Using Microsoft
  83.     FrontPage with mod_authnz_ldap</a></li>
  84. </ul><h3>See also</h3>
  85. <ul class="seealso">
  86. <li><code class="module"><a href="../mod/mod_ldap.html">mod_ldap</a></code></li>
  87. <li><code class="module"><a href="../mod/mod_auth_basic.html">mod_auth_basic</a></code></li>
  88. <li><code class="module"><a href="../mod/mod_authz_user.html">mod_authz_user</a></code></li>
  89. <li><code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code></li>
  90. </ul></div>
  91. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  92. <div class="section">
  93. <h2><a name="contents" id="contents">Contents</a></h2>
  94.  
  95.     <ul>
  96.       <li>
  97.         <a href="#operation">Operation</a> 
  98.  
  99.         <ul>
  100.           <li><a href="#authenphase">The Authentication
  101.           Phase</a></li>
  102.  
  103.           <li><a href="#authorphase">The Authorization
  104.           Phase</a></li>
  105.         </ul>
  106.       </li>
  107.  
  108.       <li>
  109.         <a href="#requiredirectives">The Require Directives</a> 
  110.  
  111.         <ul>
  112.           <li><a href="#reqvaliduser">Require valid-user</a></li>
  113.           <li><a href="#requser">Require ldap-user</a></li>
  114.           <li><a href="#reqgroup">Require ldap-group</a></li>
  115.           <li><a href="#reqdn">Require ldap-dn</a></li>
  116.           <li><a href="#reqattribute">Require ldap-attribute</a></li>
  117.           <li><a href="#reqfilter">Require ldap-filter</a></li>
  118.         </ul>
  119.       </li>
  120.  
  121.       <li><a href="#examples">Examples</a></li>
  122.       <li><a href="#usingtls">Using TLS</a></li>
  123.       <li><a href="#usingssl">Using SSL</a></li>
  124.       <li><a href="#exposed">Exposing Login Information</a></li>
  125.       <li>
  126.         <a href="#frontpage">Using Microsoft FrontPage with
  127.         <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code></a> 
  128.  
  129.         <ul>
  130.           <li><a href="#howitworks">How It Works</a></li>
  131.           <li><a href="#fpcaveats">Caveats</a></li>
  132.         </ul>
  133.       </li>
  134.     </ul>
  135. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  136. <div class="section">
  137. <h2><a name="operation" id="operation">Operation</a></h2>
  138.  
  139.     <p>There are two phases in granting access to a user. The first
  140.     phase is authentication, in which the <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code>
  141.     authentication provider verifies that the user's credentials are valid. 
  142.     This is also called the <em>search/bind</em> phase. The second phase is
  143.     authorization, in which <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> determines
  144.     if the authenticated user is allowed access to the resource in
  145.     question. This is also known as the <em>compare</em>
  146.     phase.</p>
  147.  
  148.     <p><code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> registers both an authn_ldap authentication
  149.     provider and an authz_ldap authorization handler.  The authn_ldap
  150.     authentication provider can be enabled through the 
  151.     <code class="directive"><a href="../mod/mod_auth_basic.html#authbasicprovider">AuthBasicProvider</a></code> directive 
  152.     using the <code>ldap</code> value. The authz_ldap handler extends the 
  153.     <code class="directive"><a href="../mod/core.html#require">Require</a></code> directive's authorization types
  154.     by adding <code>ldap-user</code>, <code>ldap-dn</code> and <code>ldap-group</code> 
  155.     values.</p>
  156.  
  157. <h3><a name="authenphase" id="authenphase">The Authentication
  158.     Phase</a></h3>
  159.  
  160.     <p>During the authentication phase, <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code>
  161.     searches for an entry in the directory that matches the username
  162.     that the HTTP client passes. If a single unique match is found,
  163.     then <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> attempts to bind to the
  164.     directory server using the DN of the entry plus the password
  165.     provided by the HTTP client. Because it does a search, then a
  166.     bind, it is often referred to as the search/bind phase. Here are
  167.     the steps taken during the search/bind phase.</p>
  168.  
  169.     <ol>
  170.       <li>Generate a search filter by combining the attribute and
  171.       filter provided in the <code class="directive"><a href="#authldapurl">AuthLDAPURL</a></code> directive with
  172.       the username passed by the HTTP client.</li>
  173.  
  174.       <li>Search the directory using the generated filter. If the
  175.       search does not return exactly one entry, deny or decline
  176.       access.</li>
  177.  
  178.       <li>Fetch the distinguished name of the entry retrieved from
  179.       the search and attempt to bind to the LDAP server using the
  180.       DN and the password passed by the HTTP client. If the bind is
  181.       unsuccessful, deny or decline access.</li>
  182.     </ol>
  183.  
  184.     <p>The following directives are used during the search/bind
  185.     phase</p>
  186.  
  187.     <table>
  188.       
  189.       <tr>
  190.         <td><code class="directive"><a href="#authldapurl">AuthLDAPURL</a></code></td>
  191.  
  192.         <td>Specifies the LDAP server, the
  193.         base DN, the attribute to use in the search, as well as the
  194.         extra search filter to use.</td>
  195.       </tr>
  196.  
  197.       <tr>
  198.         <td><code class="directive"><a href="#authldapbinddn">AuthLDAPBindDN</a></code></td>
  199.  
  200.         <td>An optional DN to bind with
  201.         during the search phase.</td>
  202.       </tr>
  203.  
  204.       <tr>
  205.         <td><code class="directive"><a href="#authldapbindpassword">AuthLDAPBindPassword</a></code></td>
  206.  
  207.         <td>An optional password to bind
  208.         with during the search phase.</td>
  209.       </tr>
  210.     </table>
  211.  
  212.  
  213. <h3><a name="authorphase" id="authorphase">The Authorization Phase</a></h3>
  214.  
  215.     <p>During the authorization phase, <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code>
  216.     attempts to determine if the user is authorized to access the
  217.     resource.  Many of these checks require
  218.     <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> to do a compare operation on the
  219.     LDAP server. This is why this phase is often referred to as the
  220.     compare phase. <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> accepts the
  221.     following <code class="directive"><a href="../mod/core.html#require">Require</a></code>
  222.     directives to determine if the credentials are acceptable:</p>
  223.  
  224.     <ul>
  225.       <li>Grant access if there is a <a href="#reqgroup"><code>Require ldap-user</code></a> directive, and the
  226.       username in the directive matches the username passed by the
  227.       client.</li>
  228.  
  229.       <li>Grant access if there is a <a href="#reqdn"><code>Require
  230.       ldap-dn</code></a> directive, and the DN in the directive matches
  231.       the DN fetched from the LDAP directory.</li>
  232.  
  233.       <li>Grant access if there is a <a href="#reqgroup"><code>Require ldap-group</code></a> directive, and
  234.       the DN fetched from the LDAP directory (or the username
  235.       passed by the client) occurs in the LDAP group.</li>
  236.  
  237.       <li>Grant access if there is a <a href="#reqattribute">
  238.       <code>Require ldap-attribute</code></a> 
  239.       directive, and the attribute fetched from the LDAP directory
  240.       matches the given value.</li> 
  241.  
  242.       <li>Grant access if there is a <a href="#reqfilter">
  243.       <code>Require ldap-filter</code></a> 
  244.       directive, and the search filter successfully finds a single user
  245.       object that matches the dn of the authenticated user.</li> 
  246.  
  247.       <li>otherwise, deny or decline access</li>
  248.     </ul>
  249.  
  250.     <p>Other <code class="directive"><a href="../mod/core.html#require">Require</a></code> values may also
  251.     be used which may require loading additional authorization modules.
  252.     Note that if you use a <code class="directive"><a href="../mod/core.html#require">Require</a></code>
  253.     value from another authorization module, you will need to ensure that
  254.     <code class="directive"><a href="#authzldapauthoritative">AuthzLDAPAuthoritative</a></code>
  255.     is set to <code>off</code> to allow the authorization phase to fall
  256.     back to the module providing the alternate
  257.     <code class="directive"><a href="../mod/core.html#require">Require</a></code> value.</p>
  258.  
  259.     <ul>
  260.         <li>Grant access if there is a <a href="#requser"><code>Require
  261.         valid-user</code></a> directive. (requires 
  262.         <code class="module"><a href="../mod/mod_authz_user.html">mod_authz_user</a></code>)</li>
  263.  
  264.         <li>Grant access if there is a <a href="#reqgroup"><code>Require group</code></a> directive, and
  265.         <code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code> has been loaded with the 
  266.         <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> 
  267.         directive set.</li>
  268.     
  269.         <li>others...</li>
  270.      </ul>
  271.  
  272.  
  273.     <p><code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> uses the following directives during the
  274.     compare phase:</p>
  275.  
  276.     <table>
  277.       
  278.       <tr>
  279.         <td><code class="directive"><a href="#authldapurl">AuthLDAPURL</a></code> </td>
  280.  
  281.         <td>The attribute specified in the
  282.         URL is used in compare operations for the <code>Require
  283.         ldap-user</code> operation.</td>
  284.       </tr>
  285.  
  286.       <tr>
  287.         <td><code class="directive"><a href="#authldapcomparednonserver">AuthLDAPCompareDNOnServer</a></code></td>
  288.  
  289.         <td>Determines the behavior of the
  290.         <code>Require ldap-dn</code> directive.</td>
  291.       </tr>
  292.  
  293.       <tr>
  294.         <td><code class="directive"><a href="#authldapgroupattribute">AuthLDAPGroupAttribute</a></code></td>
  295.  
  296.         <td>Determines the attribute to
  297.         use for comparisons in the <code>Require ldap-group</code>
  298.         directive.</td>
  299.       </tr>
  300.  
  301.       <tr>
  302.         <td><code class="directive"><a href="#authldapgroupattributeisdn">AuthLDAPGroupAttributeIsDN</a></code></td>
  303.  
  304.         <td>Specifies whether to use the
  305.         user DN or the username when doing comparisons for the
  306.         <code>Require ldap-group</code> directive.</td>
  307.       </tr>
  308.     </table>
  309.  
  310. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  311. <div class="section">
  312. <h2><a name="requiredirectives" id="requiredirectives">The Require Directives</a></h2>
  313.  
  314.     <p>Apache's <code class="directive"><a href="../mod/core.html#require">Require</a></code>
  315.     directives are used during the authorization phase to ensure that
  316.     a user is allowed to access a resource.  mod_authnz_ldap extends the 
  317.     authorization types with <code>ldap-user</code>, <code>ldap-dn</code>, 
  318.     <code>ldap-group</code>, <code>ldap-attribute</code> and 
  319.     <code>ldap-filter</code>.  Other authorization types may also be 
  320.     used but may require that additional authorization modules be loaded.</p>
  321.  
  322. <h3><a name="reqvaliduser" id="reqvaliduser">Require valid-user</a></h3>
  323.  
  324.     <p>If this directive exists, <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> grants
  325.     access to any user that has successfully authenticated during the
  326.     search/bind phase.  Requires that <code class="module"><a href="../mod/mod_authz_user.html">mod_authz_user</a></code> be 
  327.     loaded and that the 
  328.     <code class="directive"><a href="#authzldapauthoritative">AuthzLDAPAuthoritative</a></code>
  329.     directive be set to off.</p>
  330.  
  331.  
  332. <h3><a name="requser" id="requser">Require ldap-user</a></h3>
  333.  
  334.     <p>The <code>Require ldap-user</code> directive specifies what
  335.     usernames can access the resource. Once
  336.     <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> has retrieved a unique DN from the
  337.     directory, it does an LDAP compare operation using the username
  338.     specified in the <code>Require ldap-user</code> to see if that username
  339.     is part of the just-fetched LDAP entry.  Multiple users can be
  340.     granted access by putting multiple usernames on the line,
  341.     separated with spaces. If a username has a space in it, then it
  342.     must be surrounded with double quotes. Multiple users can also be
  343.     granted access by using multiple <code>Require ldap-user</code>
  344.     directives, with one user per line. For example, with a <code class="directive"><a href="#authldapurl">AuthLDAPURL</a></code> of
  345.     <code>ldap://ldap/o=Airius?cn</code> (i.e., <code>cn</code> is
  346.     used for searches), the following Require directives could be used
  347.     to restrict access:</p>
  348. <div class="example"><p><code>
  349. Require ldap-user "Barbara Jenson"<br />
  350. Require ldap-user "Fred User"<br />
  351. Require ldap-user "Joe Manager"<br />
  352. </code></p></div>
  353.  
  354.     <p>Because of the way that <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> handles this
  355.     directive, Barbara Jenson could sign on as <em>Barbara
  356.     Jenson</em>, <em>Babs Jenson</em> or any other <code>cn</code> that
  357.     she has in her LDAP entry. Only the single <code>Require
  358.     ldap-user</code> line is needed to support all values of the attribute
  359.     in the user's entry.</p>
  360.  
  361.     <p>If the <code>uid</code> attribute was used instead of the
  362.     <code>cn</code> attribute in the URL above, the above three lines
  363.     could be condensed to</p>
  364. <div class="example"><p><code>Require ldap-user bjenson fuser jmanager</code></p></div>
  365.  
  366.  
  367. <h3><a name="reqgroup" id="reqgroup">Require ldap-group</a></h3>
  368.  
  369.     <p>This directive specifies an LDAP group whose members are
  370.     allowed access. It takes the distinguished name of the LDAP
  371.     group. Note: Do not surround the group name with quotes.
  372.     For example, assume that the following entry existed in
  373.     the LDAP directory:</p>
  374. <div class="example"><p><code>
  375. dn: cn=Administrators, o=Airius<br />
  376. objectClass: groupOfUniqueNames<br />
  377. uniqueMember: cn=Barbara Jenson, o=Airius<br />
  378. uniqueMember: cn=Fred User, o=Airius<br />
  379. </code></p></div>
  380.  
  381.     <p>The following directive would grant access to both Fred and
  382.     Barbara:</p>
  383. <div class="example"><p><code>Require ldap-group cn=Administrators, o=Airius</code></p></div>
  384.  
  385.     <p>Behavior of this directive is modified by the <code class="directive"><a href="#authldapgroupattribute">AuthLDAPGroupAttribute</a></code> and
  386.     <code class="directive"><a href="#authldapgroupattributeisdn">AuthLDAPGroupAttributeIsDN</a></code>
  387.     directives.</p>
  388.  
  389.  
  390. <h3><a name="reqdn" id="reqdn">Require ldap-dn</a></h3>
  391.  
  392.     <p>The <code>Require ldap-dn</code> directive allows the administrator
  393.     to grant access based on distinguished names. It specifies a DN
  394.     that must match for access to be granted. If the distinguished
  395.     name that was retrieved from the directory server matches the
  396.     distinguished name in the <code>Require ldap-dn</code>, then
  397.     authorization is granted. Note: do not surround the distinguished
  398.     name with quotes.</p>
  399.  
  400.     <p>The following directive would grant access to a specific
  401.     DN:</p>
  402. <div class="example"><p><code>Require ldap-dn cn=Barbara Jenson, o=Airius</code></p></div>
  403.  
  404.     <p>Behavior of this directive is modified by the <code class="directive"><a href="#authldapcomparednonserver">AuthLDAPCompareDNOnServer</a></code>
  405.     directive.</p>
  406.  
  407.  
  408. <h3><a name="reqattribute" id="reqattribute">Require ldap-attribute</a></h3>
  409.  
  410.     <p>The <code>Require ldap-attribute</code> directive allows the
  411.     administrator to grant access based on attributes of the authenticated
  412.     user in the LDAP directory.  If the attribute in the directory
  413.     matches the value given in the configuration, access is granted.</p>
  414.     
  415.     <p>The following directive would grant access to anyone with
  416.     the attribute employeeType = active</p>
  417.  
  418.     <div class="example"><p><code>Require ldap-attribute employeeType=active</code></p></div>
  419.  
  420.     <p>Multiple attribute/value pairs can be specified on the same line
  421.     separated by spaces or they can be specified in multiple 
  422.     <code>Require ldap-attribute</code> directives. The effect of listing 
  423.     multiple attribute/values pairs is an OR operation. Access will be 
  424.     granted if any of the listed attribute values match the value of the 
  425.     corresponding attribute in the user object. If the value of the 
  426.     attribute contains a space, only the value must be within double quotes.</p>
  427.  
  428.     <p>The following directive would grant access to anyone with
  429.     the city attribute equal to "San Jose" or status equal to "Active"</p>
  430.  
  431.     <div class="example"><p><code>Require ldap-attribute city="San Jose" status=active</code></p></div>
  432.  
  433.  
  434.  
  435. <h3><a name="reqfilter" id="reqfilter">Require ldap-filter</a></h3>
  436.  
  437.     <p>The <code>Require ldap-filter</code> directive allows the
  438.     administrator to grant access based on a complex LDAP search filter.
  439.     If the dn returned by the filter search matches the authenticated user
  440.     dn, access is granted.</p>
  441.     
  442.     <p>The following directive would grant access to anyone having a cell phone
  443.     and is in the marketing department</p>
  444.  
  445.     <div class="example"><p><code>Require ldap-filter &(cell=*)(department=marketing)</code></p></div>
  446.  
  447.     <p>The difference between the <code>Require ldap-filter</code> directive and the 
  448.     <code>Require ldap-attribute</code> directive is that <code>ldap-filter</code> 
  449.     performs a search operation on the LDAP directory using the specified search 
  450.     filter rather than a simple attribute comparison. If a simple attribute 
  451.     comparison is all that is required, the comparison operation performed by 
  452.     <code>ldap-attribute</code> will be faster than the search operation 
  453.     used by <code>ldap-filter</code> especially within a large directory.</p>
  454.  
  455.  
  456.  
  457. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  458. <div class="section">
  459. <h2><a name="examples" id="examples">Examples</a></h2>
  460.  
  461.     <ul>
  462.       <li>
  463.         Grant access to anyone who exists in the LDAP directory,
  464.         using their UID for searches. 
  465. <div class="example"><p><code>
  466. AuthLDAPURL ldap://ldap1.airius.com:389/ou=People, o=Airius?uid?sub?(objectClass=*)<br />
  467. Require valid-user
  468. </code></p></div>
  469.       </li>
  470.  
  471.       <li>
  472.         The next example is the same as above; but with the fields
  473.         that have useful defaults omitted. Also, note the use of a
  474.         redundant LDAP server. 
  475. <div class="example"><p><code>AuthLDAPURL ldap://ldap1.airius.com ldap2.airius.com/ou=People, o=Airius<br />
  476. Require valid-user
  477. </code></p></div>
  478.       </li>
  479.  
  480.       <li>
  481.         The next example is similar to the previous one, but it
  482.         uses the common name instead of the UID. Note that this
  483.         could be problematical if multiple people in the directory
  484.         share the same <code>cn</code>, because a search on <code>cn</code>
  485.         <strong>must</strong> return exactly one entry. That's why
  486.         this approach is not recommended: it's a better idea to
  487.         choose an attribute that is guaranteed unique in your
  488.         directory, such as <code>uid</code>. 
  489. <div class="example"><p><code>
  490. AuthLDAPURL ldap://ldap.airius.com/ou=People, o=Airius?cn<br />
  491. Require valid-user
  492. </code></p></div>
  493.       </li>
  494.  
  495.       <li>
  496.         Grant access to anybody in the Administrators group. The
  497.         users must authenticate using their UID. 
  498. <div class="example"><p><code>
  499. AuthLDAPURL ldap://ldap.airius.com/o=Airius?uid<br />
  500. Require ldap-group cn=Administrators, o=Airius
  501. </code></p></div>
  502.       </li>
  503.  
  504.       <li>
  505.         The next example assumes that everyone at Airius who
  506.         carries an alphanumeric pager will have an LDAP attribute
  507.         of <code>qpagePagerID</code>. The example will grant access
  508.         only to people (authenticated via their UID) who have
  509.         alphanumeric pagers: 
  510. <div class="example"><p><code>
  511. AuthLDAPURL ldap://ldap.airius.com/o=Airius?uid??(qpagePagerID=*)<br />
  512. Require valid-user
  513. </code></p></div>
  514.       </li>
  515.  
  516.       <li>
  517.         <p>The next example demonstrates the power of using filters
  518.         to accomplish complicated administrative requirements.
  519.         Without filters, it would have been necessary to create a
  520.         new LDAP group and ensure that the group's members remain
  521.         synchronized with the pager users. This becomes trivial
  522.         with filters. The goal is to grant access to anyone who has
  523.         a pager, plus grant access to Joe Manager, who doesn't
  524.         have a pager, but does need to access the same
  525.         resource:</p>
  526. <div class="example"><p><code>
  527. AuthLDAPURL ldap://ldap.airius.com/o=Airius?uid??(|(qpagePagerID=*)(uid=jmanager))<br />
  528. Require valid-user
  529. </code></p></div>
  530.  
  531.         <p>This last may look confusing at first, so it helps to
  532.         evaluate what the search filter will look like based on who
  533.         connects, as shown below.  If
  534.         Fred User connects as <code>fuser</code>, the filter would look
  535.         like</p>
  536.  
  537.         <div class="example"><p><code>(&(|(qpagePagerID=*)(uid=jmanager))(uid=fuser))</code></p></div>
  538.  
  539.         <p>The above search will only succeed if <em>fuser</em> has a
  540.         pager. When Joe Manager connects as <em>jmanager</em>, the
  541.         filter looks like</p>
  542.  
  543.         <div class="example"><p><code>(&(|(qpagePagerID=*)(uid=jmanager))(uid=jmanager))</code></p></div>
  544.  
  545.         <p>The above search will succeed whether <em>jmanager</em>
  546.         has a pager or not.</p>
  547.       </li>
  548.     </ul>
  549. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  550. <div class="section">
  551. <h2><a name="usingtls" id="usingtls">Using TLS</a></h2>
  552.  
  553.     <p>To use TLS, see the <code class="module"><a href="../mod/mod_ldap.html">mod_ldap</a></code> directives <code class="directive"><a href="../mod/mod_ldap.html#ldaptrustedclientcert">LDAPTrustedClientCert</a></code>, <code class="directive"><a href="../mod/mod_ldap.html#ldaptrustedglobalcert">LDAPTrustedGlobalCert</a></code> and <code class="directive"><a href="../mod/mod_ldap.html#ldaptrustedmode">LDAPTrustedMode</a></code>.</p>
  554.  
  555.     <p>An optional second parameter can be added to the 
  556.     <code class="directive"><a href="#authldapurl">AuthLDAPURL</a></code> to override
  557.     the default connection type set by <code class="directive"><a href="../mod/mod_ldap.html#ldaptrustedmode">LDAPTrustedMode</a></code>.
  558.     This will allow the connection established by an <em>ldap://</em> Url 
  559.     to be upgraded to a secure connection on the same port.</p>
  560. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  561. <div class="section">
  562. <h2><a name="usingssl" id="usingssl">Using SSL</a></h2>
  563.  
  564.     <p>To use SSL, see the <code class="module"><a href="../mod/mod_ldap.html">mod_ldap</a></code> directives <code class="directive"><a href="../mod/mod_ldap.html#ldaptrustedclientcert">LDAPTrustedClientCert</a></code>, <code class="directive"><a href="../mod/mod_ldap.html#ldaptrustedglobalcert">LDAPTrustedGlobalCert</a></code> and <code class="directive"><a href="../mod/mod_ldap.html#ldaptrustedmode">LDAPTrustedMode</a></code>.</p>
  565.  
  566.     <p>To specify a secure LDAP server, use <em>ldaps://</em> in the
  567.     <code class="directive"><a href="#authldapurl">AuthLDAPURL</a></code>
  568.     directive, instead of <em>ldap://</em>.</p>
  569. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  570. <div class="section">
  571. <h2><a name="exposed" id="exposed">Exposing Login Information</a></h2>
  572.  
  573.     <p>Whenever a query is made to the LDAP server, all LDAP attributes
  574.     returned by the query are placed in the environment, using environment
  575.     variables with the prefix "AUTHENTICATE_".</p>
  576.  
  577.     <p>If an LDAP query for example returned the username, common name
  578.     and telephone number of a user, a CGI program will have access to
  579.     this information without the need to make a second independent LDAP
  580.     query to gather this additional information.</p>
  581.  
  582.     <p>This has the potential to dramatically simplify the coding and
  583.     configuration required in some web applications.</p>
  584.  
  585. </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  586. <div class="section">
  587. <h2><a name="frontpage" id="frontpage">Using Microsoft
  588.     FrontPage with mod_authnz_ldap</a></h2>
  589.  
  590.     <p>Normally, FrontPage uses FrontPage-web-specific user/group
  591.     files (i.e., the <code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code> and
  592.     <code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code> modules) to handle all
  593.     authentication. Unfortunately, it is not possible to just
  594.     change to LDAP authentication by adding the proper directives,
  595.     because it will break the <em>Permissions</em> forms in
  596.     the FrontPage client, which attempt to modify the standard
  597.     text-based authorization files.</p>
  598.  
  599.     <p>Once a FrontPage web has been created, adding LDAP
  600.     authentication to it is a matter of adding the following
  601.     directives to <em>every</em> <code>.htaccess</code> file
  602.     that gets created in the web</p>
  603. <div class="example"><pre>
  604. AuthLDAPURL            "the url"
  605. AuthzLDAPAuthoritative off
  606. AuthGroupFile <em>mygroupfile</em>
  607. Require group <em>mygroupfile</em>
  608. </pre></div>
  609.  
  610.     <p><code class="directive"><a href="#authzldapauthoritative">AuthzLDAPAuthoritative</a></code> 
  611.     must be off to allow <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> to decline group
  612.     authentication so that Apache will fall back to file
  613.     authentication for checking group membership. This allows the
  614.     FrontPage-managed group file to be used.</p>
  615.  
  616. <h3><a name="howitworks" id="howitworks">How It Works</a></h3>
  617.  
  618.     <p>FrontPage restricts access to a web by adding the <code>Require
  619.     valid-user</code> directive to the <code>.htaccess</code>
  620.     files. The <code>Require valid-user</code> directive will succeed for
  621.     any user who is valid <em>as far as LDAP is
  622.     concerned</em>. This means that anybody who has an entry in
  623.     the LDAP directory is considered a valid user, whereas FrontPage
  624.     considers only those people in the local user file to be
  625.     valid. By substituting the ldap-group with group file authorization,
  626.     Apache is allowed to consult the local user file (which is managed by 
  627.     FrontPage) - instead of LDAP - when handling authorizing the user.</p>
  628.  
  629.     <p>Once directives have been added as specified above,
  630.     FrontPage users will be able to perform all management
  631.     operations from the FrontPage client.</p>
  632.  
  633.  
  634. <h3><a name="fpcaveats" id="fpcaveats">Caveats</a></h3>
  635.  
  636.     <ul>
  637.       <li>When choosing the LDAP URL, the attribute to use for
  638.       authentication should be something that will also be valid
  639.       for putting into a <code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code> user file.
  640.       The user ID is ideal for this.</li>
  641.  
  642.       <li>When adding users via FrontPage, FrontPage administrators
  643.       should choose usernames that already exist in the LDAP
  644.       directory (for obvious reasons). Also, the password that the
  645.       administrator enters into the form is ignored, since Apache
  646.       will actually be authenticating against the password in the
  647.       LDAP database, and not against the password in the local user
  648.       file. This could cause confusion for web administrators.</li>
  649.  
  650.       
  651.       <li>Apache must be compiled with <code class="module"><a href="../mod/mod_auth_basic.html">mod_auth_basic</a></code>,
  652.       <code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code> and
  653.       <code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code> in order to
  654.       use FrontPage support. This is because Apache will still use
  655.       the <code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code> group file for determine 
  656.       the extent of a user's access to the FrontPage web.</li>
  657.  
  658.       <li>The directives must be put in the <code>.htaccess</code>
  659.       files. Attempting to put them inside <code class="directive"><a href="../mod/core.html#location"><Location></a></code> or <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> directives won't work. This
  660.       is because <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> has to be able to grab
  661.       the <code class="directive"><a href="../mod/mod_authn_file.html#authgroupfile">AuthGroupFile</a></code>
  662.       directive that is found in FrontPage <code>.htaccess</code>
  663.       files so that it knows where to look for the valid user list. If
  664.       the <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> directives aren't in the same
  665.       <code>.htaccess</code> file as the FrontPage directives, then
  666.       the hack won't work, because <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> will
  667.       never get a chance to process the <code>.htaccess</code> file,
  668.       and won't be able to find the FrontPage-managed user file.</li>
  669.     </ul>
  670.  
  671. </div>
  672. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  673. <div class="directive-section"><h2><a name="AuthLDAPBindDN" id="AuthLDAPBindDN">AuthLDAPBindDN</a> <a name="authldapbinddn" id="authldapbinddn">Directive</a></h2>
  674. <table class="directive">
  675. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Optional DN to use in binding to the LDAP server</td></tr>
  676. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPBindDN <em>distinguished-name</em></code></td></tr>
  677. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  678. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  679. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  680. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authnz_ldap</td></tr>
  681. </table>
  682.     <p>An optional DN used to bind to the server when searching for
  683.     entries. If not provided, <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> will use
  684.     an anonymous bind.</p>
  685.  
  686. </div>
  687. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  688. <div class="directive-section"><h2><a name="AuthLDAPBindPassword" id="AuthLDAPBindPassword">AuthLDAPBindPassword</a> <a name="authldapbindpassword" id="authldapbindpassword">Directive</a></h2>
  689. <table class="directive">
  690. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Password used in conjuction with the bind DN</td></tr>
  691. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPBindPassword <em>password</em></code></td></tr>
  692. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  693. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  694. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  695. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authnz_ldap</td></tr>
  696. </table>
  697.     <p>A bind password to use in conjunction with the bind DN. Note
  698.     that the bind password is probably sensitive data, and should be
  699.     properly protected. You should only use the <code class="directive"><a href="#authldapbinddn">AuthLDAPBindDN</a></code> and <code class="directive"><a href="#authldapbindpassword">AuthLDAPBindPassword</a></code> if you
  700.     absolutely need them to search the directory.</p> 
  701.  
  702. </div>
  703. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  704. <div class="directive-section"><h2><a name="AuthLDAPCharsetConfig" id="AuthLDAPCharsetConfig">AuthLDAPCharsetConfig</a> <a name="authldapcharsetconfig" id="authldapcharsetconfig">Directive</a></h2>
  705. <table class="directive">
  706. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Language to charset conversion configuration file</td></tr>
  707. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPCharsetConfig <em>file-path</em></code></td></tr>
  708. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  709. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  710. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authnz_ldap</td></tr>
  711. </table>
  712.     <p>The <code class="directive">AuthLDAPCharsetConfig</code> directive sets the location
  713.     of the language to charset conversion configuration file. <var>File-path</var> is relative
  714.     to the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code>. This file specifies
  715.     the list of language extensions to character sets.
  716.     Most administrators use the provided <code>charset.conv</code>
  717.     file, which associates common language extensions to character sets.</p>
  718.  
  719.     <p>The file contains lines in the following format:</p>
  720.  
  721.     <div class="example"><p><code>
  722.       <var>Language-Extension</var> <var>charset</var> [<var>Language-String</var>] ...
  723.     </code></p></div>
  724.  
  725.     <p>The case of the extension does not matter. Blank lines, and lines
  726.     beginning with a hash character (<code>#</code>) are ignored.</p>
  727.  
  728. </div>
  729. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  730. <div class="directive-section"><h2><a name="AuthLDAPCompareDNOnServer" id="AuthLDAPCompareDNOnServer">AuthLDAPCompareDNOnServer</a> <a name="authldapcomparednonserver" id="authldapcomparednonserver">Directive</a></h2>
  731. <table class="directive">
  732. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use the LDAP server to compare the DNs</td></tr>
  733. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPCompareDNOnServer on|off</code></td></tr>
  734. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthLDAPCompareDNOnServer on</code></td></tr>
  735. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  736. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  737. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  738. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authnz_ldap</td></tr>
  739. </table>
  740.     <p>When set, <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> will use the LDAP
  741.     server to compare the DNs. This is the only foolproof way to
  742.     compare DNs.  <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> will search the
  743.     directory for the DN specified with the <a href="#reqdn"><code>Require dn</code></a> directive, then,
  744.     retrieve the DN and compare it with the DN retrieved from the user
  745.     entry. If this directive is not set,
  746.     <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> simply does a string comparison. It
  747.     is possible to get false negatives with this approach, but it is
  748.     much faster. Note the <code class="module"><a href="../mod/mod_ldap.html">mod_ldap</a></code> cache can speed up
  749.     DN comparison in most situations.</p>
  750.  
  751. </div>
  752. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  753. <div class="directive-section"><h2><a name="AuthLDAPDereferenceAliases" id="AuthLDAPDereferenceAliases">AuthLDAPDereferenceAliases</a> <a name="authldapdereferencealiases" id="authldapdereferencealiases">Directive</a></h2>
  754. <table class="directive">
  755. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>When will the module de-reference aliases</td></tr>
  756. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPDereferenceAliases never|searching|finding|always</code></td></tr>
  757. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthLDAPDereferenceAliases Always</code></td></tr>
  758. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  759. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  760. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  761. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authnz_ldap</td></tr>
  762. </table>
  763.     <p>This directive specifies when <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> will
  764.     de-reference aliases during LDAP operations. The default is
  765.     <code>always</code>.</p>
  766.  
  767. </div>
  768. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  769. <div class="directive-section"><h2><a name="AuthLDAPGroupAttribute" id="AuthLDAPGroupAttribute">AuthLDAPGroupAttribute</a> <a name="authldapgroupattribute" id="authldapgroupattribute">Directive</a></h2>
  770. <table class="directive">
  771. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>LDAP attributes used to check for group membership</td></tr>
  772. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPGroupAttribute <em>attribute</em></code></td></tr>
  773. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  774. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  775. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  776. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authnz_ldap</td></tr>
  777. </table>
  778.     <p>This directive specifies which LDAP attributes are used to
  779.     check for group membership. Multiple attributes can be used by
  780.     specifying this directive multiple times. If not specified,
  781.     then <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> uses the <code>member</code> and
  782.     <code>uniquemember</code> attributes.</p>
  783.  
  784. </div>
  785. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  786. <div class="directive-section"><h2><a name="AuthLDAPGroupAttributeIsDN" id="AuthLDAPGroupAttributeIsDN">AuthLDAPGroupAttributeIsDN</a> <a name="authldapgroupattributeisdn" id="authldapgroupattributeisdn">Directive</a></h2>
  787. <table class="directive">
  788. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use the DN of the client username when checking for
  789. group membership</td></tr>
  790. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPGroupAttributeIsDN on|off</code></td></tr>
  791. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthLDAPGroupAttributeIsDN on</code></td></tr>
  792. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  793. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  794. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  795. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authnz_ldap</td></tr>
  796. </table>
  797.     <p>When set <code>on</code>, this directive says to use the
  798.     distinguished name of the client username when checking for group
  799.     membership.  Otherwise, the username will be used. For example,
  800.     assume that the client sent the username <code>bjenson</code>,
  801.     which corresponds to the LDAP DN <code>cn=Babs Jenson,
  802.     o=Airius</code>. If this directive is set,
  803.     <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> will check if the group has
  804.     <code>cn=Babs Jenson, o=Airius</code> as a member. If this
  805.     directive is not set, then <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> will
  806.     check if the group has <code>bjenson</code> as a member.</p>
  807.  
  808. </div>
  809. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  810. <div class="directive-section"><h2><a name="AuthLDAPRemoteUserAttribute" id="AuthLDAPRemoteUserAttribute">AuthLDAPRemoteUserAttribute</a> <a name="authldapremoteuserattribute" id="authldapremoteuserattribute">Directive</a></h2>
  811. <table class="directive">
  812. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use the value of the attribute returned during the user
  813. query to set the REMOTE_USER environment variable</td></tr>
  814. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPRemoteUserAttribute uid</code></td></tr>
  815. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
  816. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  817. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  818. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  819. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authnz_ldap</td></tr>
  820. </table>
  821.     <p>If this directive is set, the value of the 
  822.     <code>REMOTE_USER</code> environment variable will be set to the
  823.     value of the attribute specified. Make sure that this attribute is
  824.     included in the list of attributes in the AuthLDAPUrl definition,
  825.     otherwise this directive will have no effect. This directive, if
  826.     present, takes precedence over AuthLDAPRemoteUserIsDN. This
  827.     directive is useful should you want people to log into a website
  828.     using an email address, but a backend application expects the
  829.     username as a userid.</p>
  830.  
  831. </div>
  832. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  833. <div class="directive-section"><h2><a name="AuthLDAPRemoteUserIsDN" id="AuthLDAPRemoteUserIsDN">AuthLDAPRemoteUserIsDN</a> <a name="authldapremoteuserisdn" id="authldapremoteuserisdn">Directive</a></h2>
  834. <table class="directive">
  835. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use the DN of the client username to set the REMOTE_USER
  836. environment variable</td></tr>
  837. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPRemoteUserIsDN on|off</code></td></tr>
  838. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthLDAPRemoteUserIsDN off</code></td></tr>
  839. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  840. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  841. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  842. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authnz_ldap</td></tr>
  843. </table>
  844.     <p>If this directive is set to on, the value of the
  845.     <code>REMOTE_USER</code> environment variable will be set to the full
  846.     distinguished name of the authenticated user, rather than just
  847.     the username that was passed by the client. It is turned off by
  848.     default.</p>
  849.  
  850. </div>
  851. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  852. <div class="directive-section"><h2><a name="AuthLDAPUrl" id="AuthLDAPUrl">AuthLDAPUrl</a> <a name="authldapurl" id="authldapurl">Directive</a></h2>
  853. <table class="directive">
  854. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URL specifying the LDAP search parameters</td></tr>
  855. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPUrl <em>url [NONE|SSL|TLS|STARTTLS]</em></code></td></tr>
  856. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  857. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  858. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  859. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authnz_ldap</td></tr>
  860. </table>
  861.     <p>An RFC 2255 URL which specifies the LDAP search parameters
  862.     to use. The syntax of the URL is</p>
  863. <div class="example"><p><code>ldap://host:port/basedn?attribute?scope?filter</code></p></div>
  864.  
  865. <dl>
  866. <dt>ldap</dt>
  867.  
  868.         <dd>For regular ldap, use the
  869.         string <code>ldap</code>. For secure LDAP, use <code>ldaps</code>
  870.         instead. Secure LDAP is only available if Apache was linked
  871.         to an LDAP library with SSL support.</dd>
  872.  
  873. <dt>host:port</dt>
  874.  
  875.         <dd>
  876.           <p>The name/port of the ldap server (defaults to
  877.           <code>localhost:389</code> for <code>ldap</code>, and
  878.           <code>localhost:636</code> for <code>ldaps</code>). To
  879.           specify multiple, redundant LDAP servers, just list all
  880.           servers, separated by spaces. <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code>
  881.           will try connecting to each server in turn, until it makes a
  882.           successful connection.</p>
  883.  
  884.           <p>Once a connection has been made to a server, that
  885.           connection remains active for the life of the
  886.           <code class="program"><a href="../programs/httpd.html">httpd</a></code> process, or until the LDAP server goes
  887.           down.</p>
  888.  
  889.           <p>If the LDAP server goes down and breaks an existing
  890.           connection, <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code> will attempt to
  891.           re-connect, starting with the primary server, and trying
  892.           each redundant server in turn. Note that this is different
  893.           than a true round-robin search.</p>
  894.         </dd>
  895.  
  896. <dt>basedn</dt>
  897.  
  898.         <dd>The DN of the branch of the
  899.         directory where all searches should start from. At the very
  900.         least, this must be the top of your directory tree, but
  901.         could also specify a subtree in the directory.</dd>
  902.  
  903. <dt>attribute</dt>
  904.  
  905.         <dd>The attribute to search for.
  906.         Although RFC 2255 allows a comma-separated list of
  907.         attributes, only the first attribute will be used, no
  908.         matter how many are provided. If no attributes are
  909.         provided, the default is to use <code>uid</code>. It's a good
  910.         idea to choose an attribute that will be unique across all
  911.         entries in the subtree you will be using.</dd>
  912.  
  913. <dt>scope</dt>
  914.  
  915.         <dd>The scope of the search. Can be either <code>one</code> or
  916.         <code>sub</code>. Note that a scope of <code>base</code> is
  917.         also supported by RFC 2255, but is not supported by this
  918.         module. If the scope is not provided, or if <code>base</code> scope
  919.         is specified, the default is to use a scope of
  920.         <code>sub</code>.</dd>
  921.  
  922. <dt>filter</dt>
  923.  
  924.         <dd>A valid LDAP search filter. If
  925.         not provided, defaults to <code>(objectClass=*)</code>, which
  926.         will search for all objects in the tree. Filters are
  927.         limited to approximately 8000 characters (the definition of
  928.         <code>MAX_STRING_LEN</code> in the Apache source code). This
  929.         should be than sufficient for any application.</dd>
  930. </dl>
  931.  
  932.     <p>When doing searches, the attribute, filter and username passed
  933.     by the HTTP client are combined to create a search filter that
  934.     looks like
  935.     <code>(&(<em>filter</em>)(<em>attribute</em>=<em>username</em>))</code>.</p>
  936.  
  937.     <p>For example, consider an URL of
  938.     <code>ldap://ldap.airius.com/o=Airius?cn?sub?(posixid=*)</code>. When
  939.     a client attempts to connect using a username of <code>Babs
  940.     Jenson</code>, the resulting search filter will be
  941.     <code>(&(posixid=*)(cn=Babs Jenson))</code>.</p>
  942.  
  943.     <p>An optional parameter can be added to allow the LDAP Url to override 
  944.     the connection type.  This parameter can be one of the following:</p>
  945.  
  946. <dl>
  947.     <dt>NONE</dt>
  948.         <dd>Establish an unsecure connection on the default LDAP port. This
  949.         is the same as <code>ldap://</code> on port 389.</dd>
  950.     <dt>SSL</dt>
  951.         <dd>Establish a secure connection on the default secure LDAP port.
  952.         This is the same as <code>ldaps://</code></dd>
  953.     <dt>TLS | STARTTLS</dt>
  954.         <dd>Establish an upgraded secure connection on the default LDAP port.
  955.         This connection will be initiated on port 389 by default and then 
  956.         upgraded to a secure connection on the same port.</dd>
  957. </dl>
  958.  
  959.     <p>See above for examples of <code class="directive"><a href="#authldapurl">AuthLDAPURL</a></code> URLs.</p>
  960.  
  961. </div>
  962. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  963. <div class="directive-section"><h2><a name="AuthzLDAPAuthoritative" id="AuthzLDAPAuthoritative">AuthzLDAPAuthoritative</a> <a name="authzldapauthoritative" id="authzldapauthoritative">Directive</a></h2>
  964. <table class="directive">
  965. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Prevent other authentication modules from
  966. authenticating the user if this one fails</td></tr>
  967. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthzLDAPAuthoritative on|off</code></td></tr>
  968. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthzLDAPAuthoritative on</code></td></tr>
  969. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  970. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  971. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  972. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_authnz_ldap</td></tr>
  973. </table>
  974.     <p>Set to <code>off</code> if this module should let other
  975.     authentication modules attempt to authenticate the user, should
  976.     authentication with this module fail. Control is only passed on
  977.     to lower modules if there is no DN or rule that matches the
  978.     supplied user name (as passed by the client).</p>
  979.  
  980. </div>
  981. </div>
  982. <div class="bottomlang">
  983. <p><span>Available Languages: </span><a href="../en/mod/mod_authnz_ldap.html" title="English"> en </a></p>
  984. </div><div id="footer">
  985. <p class="apache">Copyright 2007 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>
  986. <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>
  987. </body></html>