小编R. *_*her的帖子

基于 LDAP 组成员资格的 Apache 用户身份验证不起作用

我想验证并授权一个 LDAP 组(Windows 上的 ApacheDS 2.0.0-20,使用组中的多个 uniqueMember 属性以及 httpd 配置中的“需要 ldap-group”语句)的所有用户访问 Web 资源。

尝试进行身份验证的用户也是此 LDAP 组的一部分,如果我在 httpd 配置中使用“需要有效用户”语句而不是“需要 ldap 组”语句,则该用户将获得授权。

设置:

  • 基于 Linux 的 Apache 2.4.23(来自 OpenSuse 42.1 Apache 存储库)
  • LDAP:基于 MS Windows 的 ApacheDS 2.0.0-20

ApacheDS LDAP 中的组配置:

LDAP 组配置

httpd的配置摘录:

<AuthnProviderAlias ldap ldapconfig>
        LDAPReferrals Off
        AuthLDAPBindDN "cn=query,ou=users,o=WJWext"
        AuthLDAPBindPassword secretpassword
        AuthLDAPURL "ldap://ldap.hostname:10389/o=WJWext?uid?sub"
</AuthnProviderAlias>

...
LogLevel trace7

<Location /xy>
...
        AuthType Basic
        AuthName "xy"
        AuthBasicProvider ldapconfig
        AuthLDAPGroupAttributeIsDN on
        AuthLDAPGroupAttribute uniqueMember
        AuthLDAPMaxSubGroupDepth 0
        AuthLDAPSubGroupClass groupOfUniqueNames
        Require ldap-group cn=groupname,ou=groups,o=WJWext
...
</Location>
Run Code Online (Sandbox Code Playgroud)

httpd的日志文件显示用户可以通过身份验证,但没有被组授权:

[Tue Nov …
Run Code Online (Sandbox Code Playgroud)

httpd ldap mod-auth-ldap apache-2.4

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

apache-2.4 ×1

httpd ×1

ldap ×1

mod-auth-ldap ×1