NTLM Winbind
我在我们的服务器上使用模块auth_ntlm_winbind_module
(mod_auth_ntlm_winbind.so
)。您需要安装Samba和winbind,并正确配置并运行。
您可以从Samba项目树下载模块:
git clone git://git.samba.org/jerry/mod_auth_ntlm_winbind.git
为了通过NTLM身份验证的用户,您有以下指令添加到您的目录设置:
<Directory /srv/http>
Allow from all
AuthName "NTLM Authentication thingy"
NTLMAuth on
NTLMAuthHelper "/usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp"
NTLMBasicAuthoritative on
AuthType NTLM
require valid-user
AllowOverride all
</Directory>
当然您也需要加载该模块:
LoadModule auth_ntlm_winbind_module /usr/lib/httpd/modules/mod_auth_ntlm_winbind.so
Windows用户帐户是传递到应用程序的REMOTE_USER:
#!/usr/bin/perl
use CGI;
my $query = new CGI;
# get the windows account from the header
my $windows_account = $query->remote_user();
注意,也就是说,只有用户身份验证数据发送到受信任的站点。
Here's a website与模块上的一些信息。经由LDAP
另一种方法
直接认证是使用模块authnz_ldap_module
(mod_authnz_ldap.so
)。这可能已经默认加载了。请注意,这不是真实的单用户提示输入密码。
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
添加到您的目录定义:
<Directory /srv/http>
AuthName "Authentication required"
AuthType Basic
AuthzLDAPAuthoritative off
AuthBasicProvider ldap
# "protocol://hostname:port/base?attribute?scope?filter" NONE
# NONE indicates that an unsecure connection should be used for LDAP, i.e. port 389
AuthLDAPURL "ldap://your.ldap.server.net:389/OU=the,OU=search,OU=node,DC=domain,DC=net?sAMAccountName?sub?(objectClass=*)" NONE
# This is only needed if your LDAP server doesn't allow anonymous binds
AuthLDAPBindDN "CN=AD Bind User,OU=the,OU=bind,OU=node,DC=domain,DC=net"
AuthLDAPBindPassword super-secret
Require valid-user
AllowOverride all
</Directory>
More info about the module.
为了给适当的反应,你可能要包括你想用的USER_ID做一些细节? – rasjani 2011-06-20 17:54:34
这将如何帮助? – Louis 2011-06-27 23:42:33