📄 mod_auth_ldap.html.en
字号:
<li> <p>The next example demonstrates the power of using filters to accomplish complicated administrative requirements. Without filters, it would have been necessary to create a new LDAP group and ensure that the group's members remain synchronized with the pager users. This becomes trivial with filters. The goal is to grant access to anyone who has a filter, plus grant access to Joe Manager, who doesn't have a pager, but does need to access the same resource:</p><div class="example"><p><code>AuthLDAPURL ldap://ldap.airius.com/o=Airius?uid??(|(qpagePagerID=*)(uid=jmanager))<br />Require valid-user</code></p></div> <p>This last may look confusing at first, so it helps to evaluate what the search filter will look like based on who connects, as shown below. The text in blue is the part that is filled in using the attribute specified in the URL. The text in red is the part that is filled in using the filter specified in the URL. The text in green is filled in using the information that is retrieved from the HTTP client. If Fred User connects as <code>fuser</code>, the filter would look like</p> <div class="example"><p><code>(&(|(qpagePagerID=*)(uid=jmanager))(uid=fuser))</code></p></div> <p>The above search will only succeed if <em>fuser</em> has a pager. When Joe Manager connects as <em>jmanager</em>, the filter looks like</p> <div class="example"><p><code>(&(|(qpagePagerID=*)(uid=jmanager))(uid=jmanager))</code></p></div> <p>The above search will succeed whether <em>jmanager</em> has a pager or not.</p> </li> </ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="usingtls" id="usingtls">Using TLS</a></h2> <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#ldaptrustedca">LDAPTrustedCA</a></code> and <code class="directive"><a href="../mod/mod_ldap.html#ldaptrustedcatype">LDAPTrustedCAType</a></code>.</p></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="usingssl" id="usingssl">Using SSL</a></h2> <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#ldaptrustedca">LDAPTrustedCA</a></code> and <code class="directive"><a href="../mod/mod_ldap.html#ldaptrustedcatype">LDAPTrustedCAType</a></code>.</p> <p>To specify a secure LDAP server, use <em>ldaps://</em> in the <code class="directive"><a href="#authldapurl">AuthLDAPURL</a></code> directive, instead of <em>ldap://</em>.</p></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="frontpage" id="frontpage">Using Microsoft FrontPage with mod_auth_ldap</a></h2> <p>Normally, FrontPage uses FrontPage-web-specific user/group files (i.e., the <code class="module"><a href="../mod/mod_auth.html">mod_auth</a></code> module) to handle all authentication. Unfortunately, it is not possible to just change to LDAP authentication by adding the proper directives, because it will break the <em>Permissions</em> forms in the FrontPage client, which attempt to modify the standard text-based authorization files.</p> <p>Once a FrontPage web has been created, adding LDAP authentication to it is a matter of adding the following directives to <em>every</em> <code>.htaccess</code> file that gets created in the web</p><div class="example"><pre>AuthLDAPURL "the url"AuthLDAPAuthoritative offAuthLDAPFrontPageHack on</pre></div> <p><code class="directive"><a href="#authldapauthoritative">AuthLDAPAuthoritative</a></code> must be off to allow <code class="module"><a href="../mod/mod_auth_ldap.html">mod_auth_ldap</a></code> to decline group authentication so that Apache will fall back to file authentication for checking group membership. This allows the FrontPage-managed group file to be used.</p><h3><a name="howitworks" id="howitworks">How It Works</a></h3> <p>FrontPage restricts access to a web by adding the <code>Require valid-user</code> directive to the <code>.htaccess</code> files. If <code class="directive"><a href="#authldapfrontpagehack">AuthLDAPFrontPageHack</a></code> is not on, the <code>Require valid-user</code> directive will succeed for any user who is valid <em>as far as LDAP is concerned</em>. This means that anybody who has an entry in the LDAP directory is considered a valid user, whereas FrontPage considers only those people in the local user file to be valid. The purpose of the hack is to force Apache to consult the local user file (which is managed by FrontPage) - instead of LDAP - when handling the <code>Require valid-user</code> directive.</p> <p>Once directives have been added as specified above, FrontPage users will be able to perform all management operations from the FrontPage client.</p><h3><a name="fpcaveats" id="fpcaveats">Caveats</a></h3> <ul> <li>When choosing the LDAP URL, the attribute to use for authentication should be something that will also be valid for putting into a <code class="module"><a href="../mod/mod_auth.html">mod_auth</a></code> user file. The user ID is ideal for this.</li> <li>When adding users via FrontPage, FrontPage administrators should choose usernames that already exist in the LDAP directory (for obvious reasons). Also, the password that the administrator enters into the form is ignored, since Apache will actually be authenticating against the password in the LDAP database, and not against the password in the local user file. This could cause confusion for web administrators.</li> <li>Apache must be compiled with <code class="module"><a href="../mod/mod_auth.html">mod_auth</a></code> in order to use FrontPage support. This is because Apache will still use the <code class="module"><a href="../mod/mod_auth.html">mod_auth</a></code> group file for determine the extent of a user's access to the FrontPage web.</li> <li>The directives must be put in the <code>.htaccess</code> 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 is because <code class="module"><a href="../mod/mod_auth_ldap.html">mod_auth_ldap</a></code> has to be able to grab the <code class="directive"><a href="../mod/mod_auth.html#authuserfile">AuthUserFile</a></code> directive that is found in FrontPage <code>.htaccess</code> files so that it knows where to look for the valid user list. If the <code class="module"><a href="../mod/mod_auth_ldap.html">mod_auth_ldap</a></code> directives aren't in the same <code>.htaccess</code> file as the FrontPage directives, then the hack won't work, because <code class="module"><a href="../mod/mod_auth_ldap.html">mod_auth_ldap</a></code> will never get a chance to process the <code>.htaccess</code> file, and won't be able to find the FrontPage-managed user file.</li> </ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AuthLDAPAuthoritative" id="AuthLDAPAuthoritative">AuthLDAPAuthoritative</a> <a name="authldapauthoritative" id="authldapauthoritative">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Prevent other authentication modules fromauthenticating the user if this one fails</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPAuthoritative on|off</code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthLDAPAuthoritative on</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_ldap</td></tr></table> <p>Set to <code>off</code> if this module should let other authentication modules attempt to authenticate the user, should authentication with this module fail. Control is only passed on to lower modules if there is no DN or rule that matches the supplied user name (as passed by the client).</p></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AuthLDAPBindDN" id="AuthLDAPBindDN">AuthLDAPBindDN</a> <a name="authldapbinddn" id="authldapbinddn">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Optional DN to use in binding to the LDAP server</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPBindDN <em>distinguished-name</em></code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_ldap</td></tr></table> <p>An optional DN used to bind to the server when searching for entries. If not provided, <code class="module"><a href="../mod/mod_auth_ldap.html">mod_auth_ldap</a></code> will use an anonymous bind.</p></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AuthLDAPBindPassword" id="AuthLDAPBindPassword">AuthLDAPBindPassword</a> <a name="authldapbindpassword" id="authldapbindpassword">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Password used in conjuction with the bind DN</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPBindPassword <em>password</em></code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_ldap</td></tr></table> <p>A bind password to use in conjunction with the bind DN. Note that the bind password is probably sensitive data, and should be 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 absolutely need them to search the directory.</p> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AuthLDAPCharsetConfig" id="AuthLDAPCharsetConfig">AuthLDAPCharsetConfig</a> <a name="authldapcharsetconfig" id="authldapcharsetconfig">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Language to charset conversion configuration file</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPCharsetConfig <em>file-path</em></code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_ldap</td></tr></table> <p>The <code class="directive">AuthLDAPCharsetConfig</code> directive sets the location of the language to charset conversion configuration file. <var>File-path</var> is relative to the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code>. This file specifies the list of language extensions to character sets. Most administrators use the provided <code>charset.conv</code> file, which associates common language extensions to character sets.</p> <p>The file contains lines in the following format:</p> <div class="example"><p><code> <var>Language-Extension</var> <var>charset</var> [<var>Language-String</var>] ... </code></p></div> <p>The case of the extension does not matter. Blank lines, and lines beginning with a hash character (<code>#</code>) are ignored.</p></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AuthLDAPCompareDNOnServer" id="AuthLDAPCompareDNOnServer">AuthLDAPCompareDNOnServer</a> <a name="authldapcomparednonserver" id="authldapcomparednonserver">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use the LDAP server to compare the DNs</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthLDAPCompareDNOnServer on|off</code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AuthLDAPCompareDNOnServer on</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_auth_ldap</td></tr></table> <p>When set, <code class="module"><a href="../mod/mod_auth_ldap.html">mod_auth_ldap</a></code> will use the LDAP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -