我想验证并授权一个 LDAP 组(Windows 上的 ApacheDS 2.0.0-20,使用组中的多个 uniqueMember 属性以及 httpd 配置中的“需要 ldap-group”语句)的所有用户访问 Web 资源。
尝试进行身份验证的用户也是此 LDAP 组的一部分,如果我在 httpd 配置中使用“需要有效用户”语句而不是“需要 ldap 组”语句,则该用户将获得授权。
设置:
ApacheDS 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)