0

我正在尝试使用 mod_authz_ldap 进行用户身份验证。有一个奇怪的 LDAP 设置,我们必须绑定到 LDAP 目录

uid=user,o=organisation

然后查询

cn=xxx,o=organisation 

获取用户的凭据。以下配置实际上有效,只是它尝试使用登录用户的凭据绑定到 LDAP 目录,这不用说失败了。

为了验证这一点,我尝试以我们的 LDAP 绑定用户身份对应用程序进行身份验证,并且身份验证成功。

<Location />

    AuthType Basic
    AuthName "My LDAP authenticated app"

    AuthzLDAPLogLevel debug

    AuthBasicProvider ldap
    AuthBasicAuthoritative off
    AuthzLDAPAuthoritative off

    AuthzLDAPBindPassword bindpass
    AuthzLDAPBindDN "uid=binduser,o=my.edu.au"

    AuthzLDAPMethod ldap
    AuthzLDAPServer ldapdevel.my.edu.au
    AuthzLDAPUserBase o=my.edu.au
    AuthzLDAPUserKey cn
    AuthzLDAPUserScope base
    AuthLDAPRemoteUserAttribute cn

    Require valid-user

</Location>

Apache 错误日志以证明 mod_authz_ldap 在用户尝试再次验证应用程序时尝试绑定:

[Fri Sep 07 14:14:27 2012] [error] [client xxx.xxx.xxx.xxx] [15628] bind as cn=devraj,l=X,ou=Students,o=my.edu.au failed: 49
[Fri Sep 07 14:14:27 2012] [error] [client xxx.xxx.xxx.xxx] [15628] basic LDAP authentication of user 'devraj' failed
[Fri Sep 07 14:14:27 2012] [error] [client xxx.xxx.xxx.xxx] access to / failed, reason: verification of user id 'devraj' not configured

此外,如果我提供不正确的绑定凭据 mod_authz_ldap 抱怨无法以绑定用户身份绑定。这表明它尝试以绑定用户身份绑定,但也以身份验证用户身份绑定。

我的问题,我做错了什么导致 mod_auz_ldap 使用用户凭据绑定到 LDAP 目录?

谢谢你的时间。

4

2 回答 2

1

为什么 AuthzLDAPBindDN “uid=binduser,o=my.edu.au”?然后显示 AuthzLDAPUserKey cn。

“uid=binduser,o=my.edu.au”通常应该是来自 LDAP 的有效用户,并且通常是服务帐户。

那么 AuthzLDAPUserKey cn 将代表 LDAP 中用户的 RDN(相对可分辨名称)属性。让用户 uid=binduser 和其他用户类似:cn=devraj 对您来说是非典型的。

uid=binduser,o=my.edu.au 是否存在?

用户 cn=devraj,l=X,ou=Students,o=my.edu.au 是否存在?(或者是:uid=devraj,l=X,ou=Students,o=my.edu.au)

-吉姆

于 2012-09-09T09:06:13.173 回答
0

it attempts to use the credentials of the user logging in to bind to the LDAP directory, which needless to say fails

Why 'needless to say'? And why does it fail at all? This is exactly what it is supposed to do. Normally you should be searching the directory for the user, possibly using a system account to do so, then binding as the found user with his credentials. If that succeeds, authentication is complete. If your LDAP isn't set up to support that, it is set up wrongly.

于 2012-09-09T01:23:27.957 回答