Alfresco / alfresco-community-repo

Community Content Service Repository
https://www.alfresco.com/it/ecm-software/alfresco-community-edition
GNU Lesser General Public License v3.0
142 stars 82 forks source link

LDAP differential sync does not add restored users to group #2998

Closed lethal1986 closed 2 weeks ago

lethal1986 commented 3 weeks ago

In alfresco-content-repository-community:23.3.0 (and also in enterprise version) with LDAP differential sync we are facing a strange phenomenon.

It seems that differential synchronisation does not puts back a user to a group, if the user was previously removed and after that restored in AD.

In order to detail the problem we set up an OpenLDAP server and configure Alfresco to use this OpenLdap server ldap-authentication.properties settings.

Here are the steps we have done:

synchronizer.synchronize(true, true);

* Groups/users are synchronised into Alfresco, group "GROUP_alfresco-users" contains the following users: t1u1, t1u2 and t1u3.
here is the relevant log file:  [alfresco_full_sync.log](https://github.com/user-attachments/files/17377139/alfresco_full_sync.txt)
> 3 user(s) and 4 group(s) are synchronised.
* Now in OpenLDAP server remove users "t1u2" and "t1u3" (and also remove them from group "alfresco-users").
* Running a differential sync (in Alfresco JS console) removes users t1u2 and t1u3, and also removes them from "GROUP_alfresco-users".
```javascript
var ctxt, synchronizer;
ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
synchronizer = ctxt.getBean('userRegistrySynchronizer', Packages.org.alfresco.repo.security.sync.UserRegistrySynchronizer);

synchronizer.synchronize(false, true);

Here is the same log for enterprise version, with the same output: alfresco_enterprise.log

Additional note: It seems that the phenomenon happens, if the user has to created by Alfresco due to the differential sync.

Expected behaviour: In case of differential sync users and group membership also synchronised.

nbarithel commented 3 weeks ago

Hello,

Was the modifyTimestamp attribute updated when you restored user t1u2? Maybe you need to manually update it on OpenLDAP side?

lethal1986 commented 2 weeks ago

Hello Nicolas,

Thanks for the hint. You were right, in OpanLDAP the modifyTimestamp attribute does not changed for user "t1us2" in this case. Therefore the differential sync does not synch this user.