首页 文章

如何防止mod_authz_ldap使用登录凭据绑定到LDAP

提问于
浏览
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目录?

谢谢你的时间 .

2 回答

  • 0

    为什么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 =学生,o = my.edu.au)

    -Jim

  • 1

    它尝试使用登录用户的凭据绑定到LDAP目录,不用说失败

    为什么'不用说'?为什么它会失败呢?这正是应该做的 . 通常,您应该在目录中搜索用户,可能使用系统帐户执行此操作,然后使用其凭据绑定为找到的用户 . 如果成功,则验证完成 . 如果您的LDAP未设置为支持该设置,则会错误地设置它 .

相关问题