【发布时间】:2019-03-18 23:38:18
【问题描述】:
能否请您告诉我如何在 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>
【问题讨论】: