问题描述
上下文
在将成员从LDAP服务器导入到我们的应用程序时,我们正在添加组成员资格过滤.
We're adding group membership filtering when importing members from an LDAP server into our application.
(以前,我们从给定的ldap基本DN"导入所有成员;现在,管理员可以限制为某些组,即基本DN中的成员销售"和"HR").
(Previously we imported all members from a given ldap "base DN"; now administrators can restrict to certain groups, i.e. members "Sales" and "HR" in the base DN).
我们的应用程序支持:
-
SunONE
SunONE
活动目录
此外,我们计划仅支持静态组,而不支持动态组.
Also, we plan to support static groups only, not dynamic groups.
我们将如何完成
过去,我们将使用两次查找将成员复制到数据库中以实现此新功能.
In the past, we would use two lookups to replicate members into our database for this new functionality.
- 在baseDN中查找所有成员
- 查找组名称在列表中的所有组(包括成员)(例如销售"或"HR").通过地图以编程方式跟踪哪些用户属于哪些组",即使用组成员"属性(SunONE中的"uniqueMember",ActiveDirectory中的"member")
- 与#1和#2的结果相交以获得导入成员"
MemberOf/IsMemberOf可以减少查询和逻辑吗?
在简短的互联网研究中,我发现SunONE和ActiveDirectory具有一个属性(isMemberOf/memberOf),该属性标识该用户所属的组"
In briefish internet research, I found that SunONE and ActiveDirectory have an attribute (isMemberOf/memberOf) which identifies 'groups that this user belongs to'
从理论上讲,我们可以将上述逻辑简化为一个LDAP查询:
In theory, we could simplify the above logic to one LDAP query:
- 在baseDN中查找属于任何组成员的所有成员
MemberOf/IsMemberOf可以减少查询和逻辑吗?
了解问题: -memberOf/isMemberOf仅支持静态组 -它不支持嵌套组
Know issues: - memberOf/isMemberOf only supports static groups - it does not support nested groups
问题
- 这种方法是否可以使用memberOf/IsMemberOf工作?
- 有什么需要注意的吗?
- OpenLDAP或其他服务器如何?他们都支持这样的属性吗? (我发现OpenLDAP具有memberOf"overlay",但是管理员必须显式启用它)
参考
SunOne: http://docs.oracle.com/cd/E19575-01/820-2763/bcajq/index.html
Active Directory: http://msdn.microsoft.com/en-us/library/ms677943. aspx
Active Directory:http://msdn.microsoft.com/en-us/library/ms677943.aspx
相关的SO问题:如何编写LDAP查询以测试用户是否是组的成员?
memberOf vs. LDAP(Liferay)中的groupMembership
推荐答案
Will this approach using memberOf/IsMemberOf work?
它将在警告的情况下工作.
It will work subject to the caveats.
Any caveats?
如果它以OpenLDAP实现的工作方式起作用,则memberOf属性仅适用于启用后的条目.它不会赶上".
If it works the way the OpenLDAP implementation works, the memberOf attribute only works for entries made after it is enabled. It doesn't 'catch up'.
What about OpenLDAP or other servers? do they all support such an attribute. (I see that OpenLDAP has memberOf "overlay", but an
管理员必须明确启用它)
administrator must explicitly enable it)
您可以询问任何LDAP服务器的根DN,以了解它是否支持该功能.您对OpenLDAP对此的支持是正确的.
You can interrogate the root DN of any LDAP server to find out whether it supports the feature. You are correct about OpenLDAP's support of this.
这篇关于LDAP:是否可靠的memberOf/IsMemberOf属性可用于确定组成员身份:SunONE/ActiveDirectory/OpenLDAP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!