对具有过期帐户的多个LDAP服务器validationApache HTTPd

我们使用Apache 2.2.9中的mod_authnz_ldap和mod_authn_alias(在Debian 5.0,2.2.9-10 + lenny7中提供)来对多个Active Directory域进行身份validation以托pipeSubversion存储库。 我们目前的configuration是:

# Turn up logging LogLevel debug # Define authentication providers <AuthnProviderAlias ldap alpha> AuthLDAPBindDN "CN=Subversion,OU=Service Accounts,O=Alpha" AuthLDAPBindPassword [[REDACTED]] AuthLDAPURL ldap://dc01.alpha:3268/?sAMAccountName?sub? </AuthnProviderAlias> <AuthnProviderAlias ldap beta> AuthLDAPBindDN "CN=LDAPAuth,OU=Service Accounts,O=Beta" AuthLDAPBindPassword [[REDACTED]] AuthLDAPURL ldap://ldap.beta:3268/?sAMAccountName?sub? </AuthnProviderAlias> # Subversion Repository <Location /svn> DAV svn SVNPath /opt/svn/repo AuthName "Subversion" AuthType Basic AuthBasicProvider alpha beta AuthzLDAPAuthoritative off AuthzSVNAccessFile /opt/svn/authz require valid-user </Location> 

我们遇到的问题是拥有Alpha和Beta版帐户的用户,尤其是当他们在Alpha帐户已过期(但仍然存在;公司政策是帐户持续至less1年)时。 例如,当用户x(在Alpha中有en过期帐户,在Beta中有有效帐户)时,Apache错误日志将报告以下内容:

 [Tue May 11 13:42:07 2010] [debug] mod_authnz_ldap.c(377): [client 10.1.1.104] [14817] auth_ldap authenticate: using URL ldap://dc01.alpha:3268/?sAMAccountName?sub? [Tue May 11 13:42:08 2010] [warn] [client 10.1.1.104] [14817] auth_ldap authenticate: user x authentication failed; URI /svn/ [ldap_simple_bind_s() to check user credentials failed][Invalid credentials] [Tue May 11 13:42:08 2010] [error] [client 10.1.1.104] user x: authentication failure for "/svn/": Password Mismatch [Tue May 11 13:42:08 2010] [debug] mod_deflate.c(615): [client 10.1.1.104] Zlib: Compressed 527 to 359 : URL /svn/ 

试图validation为不存在的用户(nobodycool)会导致查询两个LDAP服务器的正确行为:

 [Tue May 11 13:42:40 2010] [debug] mod_authnz_ldap.c(377): [client 10.1.1.104] [14815] auth_ldap authenticate: using URL ldap://dc01.alpha:3268/?sAMAccountName?sub? [Tue May 11 13:42:40 2010] [warn] [client 10.1.1.104] [14815] auth_ldap authenticate: user nobodycool authentication failed; URI /svn/ [User not found][No such object] [Tue May 11 13:42:40 2010] [debug] mod_authnz_ldap.c(377): [client 10.1.1.104] [14815] auth_ldap authenticate: using URL ldap://ldap.beta:3268/?sAMAccountName?sub? [Tue May 11 13:42:44 2010] [warn] [client 10.1.1.104] [14815] auth_ldap authenticate: user nobodycool authentication failed; URI /svn/ [User not found][No such object] [Tue May 11 13:42:44 2010] [error] [client 10.1.1.104] user nobodycool not found: /svn/ [Tue May 11 13:42:44 2010] [debug] mod_deflate.c(615): [client 10.1.1.104] Zlib: Compressed 527 to 359 : URL /svn/ 

如果在Alpha中遇到过期帐户,我该如何configurationApache才能正确查询testing版?

只有当用户无法与查询中的DN匹配时, AuthzLDAPAuthoritative off指令才会使身份validation进入下一个模块。 目前,即使用户已经过期,看起来他们的账户仍然会在LDAP查询执行时被返回。

我不太了解ActiveDirectory LDAP模式,以便在此给出明确的答案,但是如果您可以向AuthLDAPURL指令中添加filter来过滤掉已过期的帐户,则应该导致用户名不匹配查询中的任何DN。 这应该导致authentication下降到下一个模块。