【问题标题】:Generic ldap nested group implementation通用 ldap 嵌套组实现
【发布时间】:2012-12-04 10:28:08
【问题描述】:

我需要为通用 AD 服务实现嵌套组成员身份。 以前,我使用的是特定的搜索过滤器(“member:1.2.840.113556.1.4.1941:="),通过它使用单个搜索请求,我能够获取该用户所属的所有组成员身份.但是,搜索过滤器似乎只适用于 MS AD 服务器,不适用于通用 AD 服务器。

那么,是否有人知道我们可以在搜索请求中发送的任何特定搜索过滤器(适用于所有 AD 服务器),通过它我可以通过单个搜索查询获得嵌套组成员身份。

在此先感谢您的帮助。

【问题讨论】:

    标签: active-directory ldap nested openldap ldap-query


    【解决方案1】:

    "member:1.2.840.113556.1.4.1941" 是 LDAP_MATCHING_RULE_IN_CHAIN,其他 LDAP 供应商很可能不会实现。 LDAP Wiki

    编辑:

    如果你想重新分配组,你可以这样做:

    使用过滤器:

        (&(objectCategory=organizationalPerson)(objectClass=User)(sAMAccountName=YOURUSER)
    
        get "distinguishedName"  (this is the user's distinguishedName)
        get "memberOf"  (this is a collection of distinguishedNames of the groups the user is a member of (minus the primary group in MS Active Directory, which should be "Domain Users"))
    
    
    
        Foreach memberOf in the collection: (This is the first level, so there is no need to check if he is there, because he is.)
    
        (&(objectCategory=group)(distinguishedName=THISMEMBEROF))
    
        get "member" (this is a collection of distinguishedNames of group members)
    
    
    
        Foreach memberOf in the collection: 
    
        This is the second level (the groups within the groups), so first check if the users distinguishedName is present.
        (&(objectCategory=group)(distinguishedName=THISMEMBEROF))
    
        get "member" (this is a collection of distinguishedNames of group members)
    
    Foreach memberOf in the collection: 
    
    This is the third level (the groups within the groups), so first check if the users distinguishedName is present.
    (&(objectCategory=group)(distinguishedName=THISMEMBEROF))
    
    get "member" (this is a collection of distinguishedNames of group members)
    
    
    
    etc.
    

    【讨论】:

    • 谢谢达罗,那么关于什么是通用方法的任何想法?也就是说,我是否一直在寻找 memberOf 属性以返回 NULL 并继续逐一提取组信息。我可以使用什么搜索过滤器?
    • 你的目标是什么?是否必须是 LDAP 查询,或者您只对组成员资格感兴趣,如果是,那么是哪个范围(通用、全局、域本地、本地、跨域)?
    • 我的目标是使用 LDAP 将用户嵌套组成员身份提升到指定级别 [(例如 5 个嵌套级别),范围 = 子树,基础 dn ]。
    • 我根据您的目标使用可能的解决方案编辑了我的答案。
    • 感谢达罗的回答。一个小疑问,为什么我必须从第二级开始检查用户专有名称是否存在?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-30
    相关资源
    最近更新 更多