Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
490 views
in Technique[技术] by (71.8m points)

ldap - Alfresco - Configure 2 groupSearchBases for Active Directory

How to configure 2 groupSearchBases for Alfresco?

Right now i have this property in my global.properties:

ldap.synchronization.groupSearchBase=CN=Alfresco users,OU=Users,OU=AWE,DC=main,DC=awe

But i need to configure second search base with path

CN=Alfresco users,OU=Labs,OU=AWE,DC=main,DC=awe

. What i have tried is to configure the property with OR statement like this:

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))

This setting gave me an error:

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'

I also minimized the searchBase path to include both of the directories like this:

ldap.synchronization.groupSearchBase=CN=Alfresco users,OU=AWE,DC=main,DC=awe

But this also gave me an error:

    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'

What i am doing wrong and how to make alfresco search for both groupSearchBases (the easiest way if possible). Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

as mentioned in the comments, the search base is a LDAP (Distinguished Name) path, not a query. This means that you should select the search base for your user and group query to a path for which both organizational units are subordinate: OU=AWE,DC=main,DC=awe.

Then you need to build the users and groups query so that only groups and users are returned as expected. E.g. for the person query can look like this:

(&
 (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)
)

for the group search you should do the same.

hint: 1.2.840.113556.1.4.1941 is a Active-Directory specific filter to retrieve nested groups (recursive retrieval of all members of that DN). For more info check Active Directory: LDAP Syntax Filters | MS Tecnet


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...