Active directory Alfresco-为Active Directory配置2个GroupSearchBase

Active directory Alfresco-为Active Directory配置2个GroupSearchBase,active-directory,ldap,alfresco,Active Directory,Ldap,Alfresco,如何为Alfresco配置2个GroupSearchBase 现在,我的global.properties中有此属性: ldap.synchronization.groupSearchBase=CN\=Alfresco users,OU\=Users,OU\=AWE,DC\=main,DC\=awe 但我需要用路径配置第二个搜索库 CN=露天用户,OU=实验室,OU=AWE,DC=main,DC=AWE 。我尝试使用或语句配置属性,如下所示: ldap.synchronization.grou

如何为Alfresco配置2个GroupSearchBase

现在,我的global.properties中有此属性:

ldap.synchronization.groupSearchBase=CN\=Alfresco users,OU\=Users,OU\=AWE,DC\=main,DC\=awe
但我需要用路径配置第二个搜索库

CN=露天用户,OU=实验室,OU=AWE,DC=main,DC=AWE

。我尝试使用语句配置属性,如下所示:

ldap.synchronization.groupSearchBase=(|(CN\=Alfresco users,OU\=Users,OU\=AWE,DC\=main,DC\=awe)(CN\=Alfresco users,OU\=Labs,OU\=AWE,DC\=main,DC\=awe))
ldap.synchronization.groupSearchBase=CN\=Alfresco users,OU\=AWE,DC\=main,DC\=awe
(&
 (objectCategory\=Person)
 (|
   (memberOf\:1.2.840.113556.1.4.1941\:\=CN\=Alfresco users,OU\=Users,OU\=AWE,DC\=main,DC\=awe)
   (memberOf\:1.2.840.113556.1.4.1941\:\=CN\=Alfresco users,OU\=Labs,OU\=AWE,DC\=main,DC\=awe)
 )
 (userAccountControl\:1.2.840.113556.1.4.803\:\=512)
)
此设置给了我一个错误:

00:30:07,147 ERROR [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] Synchronization aborted due to error
org.alfresco.error.AlfrescoRuntimeException: 02290000 Error during LDAP Search. Reason: null
...
Caused by: javax.naming.PartialResultException [Root exception is javax.naming.NamingException: LDAP response read timed out, timeout used:5000ms. [Root exception is com.sun.jndi.ldap.LdapReferralException: Continuation Reference; remaining name 'DC\=main,DC\=awe']; remaining name '']
...
Caused by: javax.naming.NamingException: LDAP response read timed out, timeout used:5000ms. [Root exception is com.sun.jndi.ldap.LdapReferralException: Continuation Reference; remaining name 'DC\=main,DC\=awe']; remaining name ''
...
Caused by: com.sun.jndi.ldap.LdapReferralException: Continuation Reference; remaining name 'DC\=main,DC\=awe'
    org.alfresco.error.AlfrescoRuntimeException: 02310000 Error during LDAP Search. Reason: [LDAP: error code 32 - 0000208D: NameErr: DSID-03100238, problem 2001 (NO_OBJECT), data 0, best match of: 'OU=AWE,DC=main,DC=awe'
...
    Caused by: javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-03100238, problem 2001 (NO_OBJECT), data 0, best match of:'OU=AWE,DC=main,DC=awe'
我还最小化了searchBase路径,以包括以下两个目录:

ldap.synchronization.groupSearchBase=(|(CN\=Alfresco users,OU\=Users,OU\=AWE,DC\=main,DC\=awe)(CN\=Alfresco users,OU\=Labs,OU\=AWE,DC\=main,DC\=awe))
ldap.synchronization.groupSearchBase=CN\=Alfresco users,OU\=AWE,DC\=main,DC\=awe
(&
 (objectCategory\=Person)
 (|
   (memberOf\:1.2.840.113556.1.4.1941\:\=CN\=Alfresco users,OU\=Users,OU\=AWE,DC\=main,DC\=awe)
   (memberOf\:1.2.840.113556.1.4.1941\:\=CN\=Alfresco users,OU\=Labs,OU\=AWE,DC\=main,DC\=awe)
 )
 (userAccountControl\:1.2.840.113556.1.4.803\:\=512)
)
但这也给了我一个错误:

00:30:07,147 ERROR [org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizer] Synchronization aborted due to error
org.alfresco.error.AlfrescoRuntimeException: 02290000 Error during LDAP Search. Reason: null
...
Caused by: javax.naming.PartialResultException [Root exception is javax.naming.NamingException: LDAP response read timed out, timeout used:5000ms. [Root exception is com.sun.jndi.ldap.LdapReferralException: Continuation Reference; remaining name 'DC\=main,DC\=awe']; remaining name '']
...
Caused by: javax.naming.NamingException: LDAP response read timed out, timeout used:5000ms. [Root exception is com.sun.jndi.ldap.LdapReferralException: Continuation Reference; remaining name 'DC\=main,DC\=awe']; remaining name ''
...
Caused by: com.sun.jndi.ldap.LdapReferralException: Continuation Reference; remaining name 'DC\=main,DC\=awe'
    org.alfresco.error.AlfrescoRuntimeException: 02310000 Error during LDAP Search. Reason: [LDAP: error code 32 - 0000208D: NameErr: DSID-03100238, problem 2001 (NO_OBJECT), data 0, best match of: 'OU=AWE,DC=main,DC=awe'
...
    Caused by: javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-03100238, problem 2001 (NO_OBJECT), data 0, best match of:'OU=AWE,DC=main,DC=awe'

我做错了什么,以及如何对两个GroupSearchBase进行alfresco搜索(如果可能的话,这是最简单的方法)。提前感谢。

如评论中所述,搜索库是LDAP(可分辨名称)路径,而不是查询。这意味着您应该为您的用户和组查询选择一个搜索库,该搜索库指向两个组织单位都是从属的路径:
OU=AWE,DC=main,DC=AWE

然后,您需要构建用户和组查询,以便只按预期返回组和用户。例如,对于人员查询,可以如下所示:

ldap.synchronization.groupSearchBase=(|(CN\=Alfresco users,OU\=Users,OU\=AWE,DC\=main,DC\=awe)(CN\=Alfresco users,OU\=Labs,OU\=AWE,DC\=main,DC\=awe))
ldap.synchronization.groupSearchBase=CN\=Alfresco users,OU\=AWE,DC\=main,DC\=awe
(&
 (objectCategory\=Person)
 (|
   (memberOf\:1.2.840.113556.1.4.1941\:\=CN\=Alfresco users,OU\=Users,OU\=AWE,DC\=main,DC\=awe)
   (memberOf\:1.2.840.113556.1.4.1941\:\=CN\=Alfresco users,OU\=Labs,OU\=AWE,DC\=main,DC\=awe)
 )
 (userAccountControl\:1.2.840.113556.1.4.803\:\=512)
)
对于组搜索,您也应该这样做


提示:
1.2.840.113556.1.4.1941
是一个特定于Active Directory的筛选器,用于检索嵌套组(递归检索该DN的所有成员)。有关更多信息,请查看注释中提到的,搜索库是LDAP(可分辨名称)路径,而不是查询。这意味着您应该为您的用户和组查询选择一个搜索库,该搜索库指向两个组织单位都是从属的路径:
OU=AWE,DC=main,DC=AWE

然后,您需要构建用户和组查询,以便只按预期返回组和用户。例如,对于人员查询,可以如下所示:

ldap.synchronization.groupSearchBase=(|(CN\=Alfresco users,OU\=Users,OU\=AWE,DC\=main,DC\=awe)(CN\=Alfresco users,OU\=Labs,OU\=AWE,DC\=main,DC\=awe))
ldap.synchronization.groupSearchBase=CN\=Alfresco users,OU\=AWE,DC\=main,DC\=awe
(&
 (objectCategory\=Person)
 (|
   (memberOf\:1.2.840.113556.1.4.1941\:\=CN\=Alfresco users,OU\=Users,OU\=AWE,DC\=main,DC\=awe)
   (memberOf\:1.2.840.113556.1.4.1941\:\=CN\=Alfresco users,OU\=Labs,OU\=AWE,DC\=main,DC\=awe)
 )
 (userAccountControl\:1.2.840.113556.1.4.803\:\=512)
)
对于组搜索,您也应该这样做


提示:
1.2.840.113556.1.4.1941
是一个特定于Active Directory的筛选器,用于检索嵌套组(递归检索该DN的所有成员)。有关更多信息,请查看

您正在与哪个LDAP服务器通话?(正确的语法各不相同)Active directory。我不知道这件事我很重要@Gagravarr您只能设置一个组基数。您可以使用
OU=AWE,DC=main,DC=AWE
(其中包含OU=Labs和OU=Users),然后尝试通过groupQuery对它们进行过滤,例如
(&(objectclass=group)(|(OU=Labs)(OU=Users))(CN=Alfresco Users))
,如果组条目引用各自的OU,则这应该有效。否则(如果目标是同步这些组的成员),您还可以向personQuery添加筛选器,例如,
(&(objectclass=user)(memberOf:…)
。您只能有一个搜索库,正如@EricLavault解释的,您需要对查询进行筛选。但是,只有一些LDAP服务器支持根据条目所在的树进行过滤。IIRC与AD类似于
ou:dn:=labs
在dn中获取ou您在与什么LDAP服务器交谈?(正确的语法各不相同)Active directory。我不知道这件事我很重要@Gagravarr您只能设置一个组基数。您可以使用
OU=AWE,DC=main,DC=AWE
(其中包含OU=Labs和OU=Users),然后尝试通过groupQuery对它们进行过滤,例如
(&(objectclass=group)(|(OU=Labs)(OU=Users))(CN=Alfresco Users))
,如果组条目引用各自的OU,则这应该有效。否则(如果目标是同步这些组的成员),您还可以向personQuery添加筛选器,例如,
(&(objectclass=user)(memberOf:…)
。您只能有一个搜索库,正如@EricLavault解释的,您需要对查询进行筛选。但是,只有一些LDAP服务器支持根据条目所在的树进行过滤。IIRC与AD类似于
ou:dn:=labs
在dn中获得ou