如何在 apache 中使用基于表单的 LDAP 身份验证
How to use Form based LDAP authentication in apache
能否请您告诉我如何在 LDAP 身份验证中使用 FORM 而不是 apache 提供的默认登录弹出窗口。
下面是apache配置,当我访问一个网页时,我得到了登录页面,但是在输入用户名和密码后,我没有被重定向到请求的页面,而是再次出现登录页面(我已经检查了ldap凭据是否正常工作在默认页面中,它可以正常工作,因此 ldap 没有问题)
<Location />
# SetHandler form-login-handler
AuthName example
AuthFormProvider ldap
AuthType form
AuthFormLoginRequiredLocation http://localhost/login.html
AuthBasicProvider ldap
AuthLDAPURL ldap://localhost/dc=linuxbabe,dc=com?uid?sub?(objectClass=*)
# Require ldap-filter objectClass=posixAccount
Require valid-user
</Location>
<Location "/login.html">
Order allow,Deny
Allow from all
require all granted
</Location>
<Location /dologin.html>
SetHandler form-login-handler
AuthType form
AuthName example
AuthFormProvider ldap
AuthFormLoginRequiredLocation http://localhost/login.html
</Location>
<html>
<head><title>Test Login</title></head>
<body>
<form method="POST" action="/dologin.html">
Username: <input type="text" name="httpd_username" value="" />
Password: <input type="password" name="httpd_password" value="" />
<input type="submit" name="login" value="Login" />
<input type="hidden" name="httpd_location"
value="http://localhost/index.html" />
</form>
</body>
</html>
mod_auth_form 的文档在开头说:
Form authentication depends on the mod_session modules
因此您必须选择并配置 mod_session 模块之一。
能否请您告诉我如何在 LDAP 身份验证中使用 FORM 而不是 apache 提供的默认登录弹出窗口。
下面是apache配置,当我访问一个网页时,我得到了登录页面,但是在输入用户名和密码后,我没有被重定向到请求的页面,而是再次出现登录页面(我已经检查了ldap凭据是否正常工作在默认页面中,它可以正常工作,因此 ldap 没有问题)
<Location />
# SetHandler form-login-handler
AuthName example
AuthFormProvider ldap
AuthType form
AuthFormLoginRequiredLocation http://localhost/login.html
AuthBasicProvider ldap
AuthLDAPURL ldap://localhost/dc=linuxbabe,dc=com?uid?sub?(objectClass=*)
# Require ldap-filter objectClass=posixAccount
Require valid-user
</Location>
<Location "/login.html">
Order allow,Deny
Allow from all
require all granted
</Location>
<Location /dologin.html>
SetHandler form-login-handler
AuthType form
AuthName example
AuthFormProvider ldap
AuthFormLoginRequiredLocation http://localhost/login.html
</Location>
<html>
<head><title>Test Login</title></head>
<body>
<form method="POST" action="/dologin.html">
Username: <input type="text" name="httpd_username" value="" />
Password: <input type="password" name="httpd_password" value="" />
<input type="submit" name="login" value="Login" />
<input type="hidden" name="httpd_location"
value="http://localhost/index.html" />
</form>
</body>
</html>
mod_auth_form 的文档在开头说:
Form authentication depends on the mod_session modules
因此您必须选择并配置 mod_session 模块之一。