Periodic Changed Users Sync


Trying to use Periodic Changed Users Sync with filter. I enabled debug logging on
From logging I can see filter and baseDn being used but no users are being picked up. However if I run the same search & filter using ApacheStudio, I see what is expected: 2 users returned by query

2021-10-06 19:48:35,119 TRACE [] (Timer-2) Using filter for LDAP search: (&(objectClass=inetOrgPerson)(memberOf:1.2.840.113556.1.4.1941:=CN=Programs,OU=People,O=pgatour,DC=pga,DC=local)(|(whenCreated>=20211006194435.0Z)(whenChanged>=20211006194435.0Z))(objectclass=person)(objectclass=organizationalPerson)(objectclass=user)) . Searching in DN: OU=People,O=pgatour,DC=pga,DC=local
2021-10-06 19:48:35,119 DEBUG [] (Timer-2) Creating LdapContext using properties: [{, java.naming.ldap.attributes.binary=objectGUID, java.naming.provider.url=ldap://, com.sun.jndi.ldap.connect.pool=true, java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory,**************************************,}]
2021-10-06 19:48:35,123 TRACE [] (Timer-2)
LdapOperation: searchPaginated
 baseDn: OU=People,O=pgatour,DC=pga,DC=local
 filter: (&(objectClass=inetOrgPerson)(memberOf:1.2.840.113556.1.4.1941:=CN=Programs,OU=People,O=pgatour,DC=pga,DC=local)(|(whenCreated>=20211006194435.0Z)(whenChanged>=20211006194435.0Z))(objectclass=person)(objectclass=organizationalPerson)(objectclass=user))
 searchScope: 2
 returningAttrs: [cn, whenCreated, sn, mail, whenChanged, givenName, pwdLastSet, userAccountControl]
 limit: 1000
 resultSize: 0

Any other suggestions on why this might not be working in keycloak sync?


So I think I’ve figured some more out about how this works. The Sync Changed Users appends:
to the filter. In my limited understanding of above and my testing it seems it only looks for users who have changed NOT new users that have been added to group. So, if I add user to the groups being captured by the filter, they do not get populated. However, it I change something about the user, they do appear, get synced as new users
Any suggestions on how to change filter such that nw members in group are synced?