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