使域身份验证正常工作:xampplite 2.2 + Server 2003

使域身份验证正常工作:xampplite 2.2 + Server 2003

每当我尝试解决此设置时,我的灵魂就会逐渐消亡。我有一台 Windows XP 计算机,上面安装了 xampplite 和 Apache 2.2.11。我希望能够使用公司的 Active Directory(Server 2003)对用户进行身份验证。

我无法使用 IIS,因为我们想要运行的产品无法在其上运行;并且我无法使用 UNIX 服务器,因为我们使用该产品需要 Windows 功能。

我首先想到的是使用 mod_auth_kerb5。它听起来是个好主意;无需登录的身份验证会很棒。问题是我找不到它的 Windows 二进制文件,编译它似乎是一件非常痛苦的事情:首先获取 MinGW/Cygwin,然后获取模块的源代码,这需要 Kerberos 5 的源代码,而 Kerberos 5 本身又需要 Perl,找出所有依赖项并编译它们,这对我来说真的没有什么吸引力。

因此,作为一种弱妥协,我认为我可以诉诸 LDAP 身份验证。但是,通过 SSL 使用 LDAP 不起作用,Apache 报告了如下内容:

[LDAP: ldap_simple_bind_s() failed][Server down]

因此我决定放弃 SSL,至少看看它是否有效,但结果证明它无效:

[client 192.168.215.18] [4984] auth_ldap authenticate: user foobar authentication
failed; URI /app/webroot/ [ldap_search_ext_s() for user failed][Operations Error]

通过 Google 搜索该错误,我得到了几个结果,并且我调整了我的配置以反映人们建议的大多数修复,但无济于事。

这是我的配置文件:

AuthType basic
AuthName "Super-secret area"
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthLDAPUrl "ldap://server1:3268 server2:3268 server3:3268/dc=domain,dc=ext?sAMAccountName?sub?(objectClass=*)"
Require valid-user

此时,只要我能通过 AD 服务器进行身份验证,任何建议都会受到欢迎。

答案1

我发现你需要绑定用户名/密码才能使其工作。只需添加:

AuthLDAPBindDN "John Doe"
AuthLDAPBindPassword secret

就可以了。

我还必须补充一点,指令的顺序是相关的(或者有某种严重的黑魔法在与我作对)。这是我的指令,它起作用了(将AuthLDAPBindDN和放在AuthLDAPBindPassword后面AuthLDAPUrl会失败):

AuthBasicProvider ldap
AuthType basic
AuthName Bromine
AuthzLDAPAuthoritative off
AuthLDAPBindDN [email protected]
AuthLDAPBindPassword secret
AuthLDAPUrl "ldap://example.com/DC=example,DC=com?sAMAccountName?sub?(objectClass=*)" NONE
Require valid-user

相关内容