Really strange.
Are you using the latest committed version of AD connector?
I provided a sync test really complete from my point of view. In particular, with reference to your issue, I verify creation, group IN and group OUT.
Please, let me have more information about.
Regards,
F.
Thanks Fabio for the response.
We are using a two month old version of AD connector. But today I took the latest AD connector code from the trunk and configured it in Syncope and the result is the same !
Then I configured SyncTest.java to point to my local AD and even that is failing after the group membership update (SyncTest.java:234). Please let me know your thoughts.
java.lang.AssertionError: expected:<1> but was:<0>
at org.junit.Assert.fail(Assert.java:91)
at org.junit.Assert.failNotEquals(Assert.java:645)
at org.junit.Assert.assertEquals(Assert.java:126)
at org.junit.Assert.assertEquals(Assert.java:470)
at org.junit.Assert.assertEquals(Assert.java:454)
at org.connid.ad.sync.SyncTest.sync(SyncTest.java:234)
Hi Fabio,
I have not customized anything. I took the latest code from trunk and only modified the ad.properties. Please find my ad.properties below:
host = 172.16.147.129
port = 636
principal = cn=administrator,cn=Users,DC=poc,DC=demo,DC=com
credentials = password
usersBaseContext = cn=Users,DC=poc,DC=demo,DC=com
baseContextToSynchronize = DC=poc,DC=demo,DC=com
memberships = CN=Domain Guests,cn=Users,DC=poc,DC=demo,DC=com ; CN=Domain Computers,cn=Users,DC=poc,DC=demo,DC=com
Thanks Fabio for the quick response.
The number of members indicated in the group is correct. I also tried adding the user to a group that doesn't have any space in between. But that is also not getting picked up in the sync.
Currently I'm Not trying with Syncope as it's clear that issue is with the connector. I'm using 'SyncTest.java' for my testing.
Hi Fabio,
Please find the log files attached (org.connid.ad.sync.SyncTest-output.txt and org.connid.ad.sync.SyncTest.txt).
I will start posting in the conn id mailing list going forward.
<org.connid.ad.SyncTest-output.txt><org.connid.ad.SyncTest.txt>
Il giorno 08/dic/2011, alle ore 00.01, Antony Pulicken ha scritto:Hi Fabio,
Please find the log files attached (org.connid.ad.sync.SyncTest-output.txt and org.connid.ad.sync.SyncTest.txt).
I will start posting in the conn id mailing list going forward.Hi Antony,as you know Active Directory (JNDI implementation) connector works only with some version of windows servers (take a look at wiki page).In case of Windows Server 2003 consider that you have to raise functional level and forest function level of your AD to "Windows Server 2003".This limitation is due to the use of a particular flag of the DirSync control.This flag is used to perform incremental searches and it influences member group IN/OUT (this is exactly your issue).Please, verify your windows version and configuration (functional level in case of 2003) and let me know.Furthermore, I opened a new issue on Syncope (#245) in order to manage array attribute better than now.Thank you again for your collaboration.Best regards,F.
I did a workaround for it..Actually, I'm not sure whether it's a workaround or a fix... please see the highlighted part in the code snippet from ADSyncStrategy.handleSyncDelta() and let me know your thoughts..Actually, member00 and member11 are handled in the same way...and it is working fine for the initial test cases that I executed in Syncope. Please let me know your thoughts...
if (member00 != null) {
// users to be removed
if (LOG.isOk()) {
LOG.ok("Found users 'OUT' ...");
}
final NamingEnumeration<String> userDNs =
(NamingEnumeration<String>) member00.getAll();
while (userDNs.hasMoreElements()) {
userDN = userDNs.next();
if (LOG.isOk()) {
LOG.ok("OUT user {0}", userDN);
}
profile = ctx.getAttributes(userDN);
guid = DirSyncUtils.getGuidAsString(
(byte[]) profile.get("objectGUID").get());
if (!handled.contains(guid)) {
handled.add(guid);
handler.handle(getSyncDelta(
oclass,
userDN,
SyncDeltaType.CREATE_OR_UPDATE, //SyncDeltaType.DELETE,
profile));
}
}
}On Mon, Dec 12, 2011 at 9:24 AM, Antony Pulicken <antony....@gmail.com> wrote:Further to the mail below, since I was not sure how to set 'Memberships' property from Syncope, I modified ADConfiguration.java constructor to pick up the valid groups from a configuration file.
The sync started working fine partially as the addition of user groups were immediately getting synced to syncope. How ever, when we remove a user from an user group, the user is getting deleted and re-created in syncope. Have you tested this scenario before ? Please let me know.
Thanks and Regards,
Antony.On Sun, Dec 11, 2011 at 9:49 PM, Antony Pulicken <antony....@gmail.com> wrote:Thanks a lot Fabio. The test case is working fine after I raised the function level. But syncope still doesn't seem to work and I think it is because I have not set the 'Memberships'property of the ADConnector. Can you tell me where/how I can set this
Il giorno 19/dic/2011, alle ore 13.53, Antony Pulicken ha scritto:Antony, you found a bug in ad connector test. I've just fixed it as follows:Sure Fabio. I will send the mail to the mailing list. The only reason it came to you directly is because you had sent a mail directly to me and I just responded to that. Anyway, sorry for that.
1. must be provided exactly 2 groups in ad.properties (added a comment)2. evaluations must be done evaluating memberships in OR (modified SyncTest.java)3. modified some assertion into SyncTest.javaThank you for your feedbacks.Let me know in mailing list about your integration between syncope and ad.Regards,F.1. email should be an e-mail --> is sAMAccountName an email?
Not sure how that happened. I have reverted it back again now.
2. by default userId schema is mandatory (and is an email) be sure to remove it or map it on an external attribute
Didn't quite get it.
I will send a mail with the details that you requested to the mailing list after testing this change.
Regards,
Antony.On Mon, Dec 19, 2011 at 5:34 PM, Fabio Martelli <fabio.m...@gmail.com> wrote:
Hi Antony,I have to ask you to write in mailing list (please, attach screenshots and syncope log files).... Questions and answers can help someone else ....
In the meanwhile, be sure to have configured the correct user schema mapping:1. email should be an e-mail --> is sAMAccountName an email?2. by default userId schema is mandatory (and is an email) be sure to remove it or map it on an external attribute....I will wait for your email in mailing list.Regards,F.Il giorno 19/dic/2011, alle ore 12.00, Antony Pulicken ha scritto:Sorry Fabio. Please ignore my previous mail. I set AdConfiguration.membershipsInOr to true and SyncTest went through. The earlier issue I mentioned was a data issue. How ever, I'm still struggling with syncope and not sure why I got javax.naming.OperationNotSupportedException in Syncope. Please find attached the screenshots of the connector/resource configuration of the AD connector and let me know in case you find anything wrong with the configuration.
If you don't have time to look at it, please send me a screenshot of your AD connector and resource configuration so that I can compare.
Thanks and Regards,
Antony.On Mon, Dec 19, 2011 at 4:09 PM, Antony Pulicken <antony....@gmail.com> wrote:
I took the latest from trunk (AD Connector) and I'm getting javax.naming.OperationNotSupportedException in both SyncTest.java and in Syncope. Can you please run SyncTest.java and see what happens at your end ? Please find the log details below:
javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 00002103: LdapErr: DSID-0C090769, comment: Error processing control, data 0, vece]; remaining name 'DC=poc,DC=demo,DC=com'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3140)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3013)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2820)
at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1829)
at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1752)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:338)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:321)
at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:248)
at org.connid.ad.sync.ADSyncStrategy.search(ADSyncStrategy.java:97)
at org.connid.ad.sync.ADSyncStrategy.sync(ADSyncStrategy.java:201)
at org.connid.ad.ADConnector.sync(ADConnector.java:131)
at org.identityconnectors.framework.impl.api.local.operations.SyncImpl.sync(SyncImpl.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.identityconnectors.framework.impl.api.local.operations.ConnectorAPIOperationRunnerProxy.invoke(ConnectorAPIOperationRunnerProxy.java:93)
at $Proxy11.sync(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.identityconnectors.framework.impl.api.local.operations.ThreadClassLoaderManagerProxy.invoke(ThreadClassLoaderManagerProxy.java:107)
at $Proxy11.sync(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.identityconnectors.framework.impl.api.BufferedResultsProxy$BufferedResultsHandler.run(BufferedResultsProxy.java:162)
Regards,
Antony.On Mon, Dec 19, 2011 at 2:15 PM, Fabio Martelli <fabio.m...@gmail.com> wrote:
Il giorno 19/dic/2011, alle ore 09.17, Antony Pulicken ha scritto:No new properties in ad.properties. For SyncTest.java you have nothing to do.Thanks Fabio as usual for the quick response.
I have not configured the new properties. I didn't see anything new in the ad.properties that is there on the trunk. Can you please tell me where/how to configure these new properties for the following scenarios ?
- In AD connector for running SyncTest.java
It depends on what you are implementing.
- In syncope for testing sync
1. if you want to perform an initial loading please check "Initial loading". Uncheck it after the first synchronization in order to sync members IN/OUT.2. check "Verify memberships in OR" if you want synchronize users with at least one group specified. Uncheck it if you want synchronize only members of each specified group.Please, consider that property at point 1 has been introduced only to increase initial loading performance avoiding useless actions.Please, let me know something about your further tests.Best regards,F.Regards,
Antony.
Il giorno 19/dic/2011, alle ore 07.50, Antony Pulicken ha scritto:
Hi Fabio,I took the latest AD connector code from the trunk and this issue has re-appeared. i.e, the updates of user group are not getting synchronized !! Can you please try running SyncTest.java on your environment after taking the latest code from the trunk ?
Hi Antony,are you sure to have well configured new properties?* Initial loading (check it just to perform an initial loading: this check ignore groups modifications)* Verify memberships in OR (check it if you want to verify membership using logical operator 'OR')Actually, I'm using windows server 2003 since the time we started to work on this issue.So I'm quite sure that the issue is not re-appeared.Please, let me know.Regards,F.
<Screen Shot 2011-12-19 at 4.27.59 PM.png><Screen Shot 2011-12-19 at 4.28.21 PM.png>
Hi Fabio,
I tested update and delete with just one user and couple of groups, and it's getting synchronized to syncope as expected ! I also added the user to a registered group (with out changing any other attributes of the user) and even that got synched with out any issues. Thanks for all the help !!
But when I deleted the user from a registered group, that is not getting synchronized to syncope. If we change any other attributes of the user along with the deletion from the group, then it's getting reflected in syncope. Please note that in the earlier version the user was getting re-created in syncope in this scenario and that has been resolved now. It's evident from the log files that user is getting picked up in the sync, but not getting propagated to syncope in this particular scenario. Here are the log entries : I have also attached the log file and connector configuration for your reference.
Hi Fabio,
I think I didn't explain the issue correctly. I'm not talking about the user getting deleted when we remove the user from 1 of the group.
I have mapped 'memberOf' (string, multi-value) attribute in the resource mapping and I can see that attribute getting updated in syncope when the user is added to a registered group in AD. But the vice versa is not happening. That is, when the user is removed from a group, that user group is not getting deleted from the memberOf attribute of the user in syncope. It gets updated only if we change any other attribute like first name or last name. I hope we are on the same page now.
Thanks Fabio for the detailed response.
Before discussing about the approach that we should take, can you tell me how it is working when a user is added to a registered group ? It gets synched 'independently' and you can see the new group in the memberOf attribute in syncope. The 'delete' of a user from the group should work the same way right ? Here are my thoughts on the approaches:
- I feel registering the group memberships itself is NOT a good idea. Or in other words, we should also have a mechanism where we should be able synch all the users just based on the base context irrespective of the groups they belong to? Is it possible in the current scenario.
- Regarding the approaches you suggested, I feel the first option is better even though it has a limitation( if a user will come into a not synchronized group, changes to user's memberOf attribute won't be synchronized)
I was thinking about performance .... probably what I wrote before is not so true: since, as far as I know, in general groups are much lower than users, including all groups in the DirSync search filter shouldn't be so negative in terms of performance.
- Looking for each modified group is probably be a deviation from the current approach, as current scope of synchronization is limited to the registered groups currently and it's a performance overhead like you mentioned. Or you can give this option also by having another flag? :-)
If user goes out from a group we can have one of the following actions:Thanks Fabio for the detailed response.
Before discussing about the approach that we should take, can you tell me how it is working when a user is added to a registered group ? It gets synched 'independently' and you can see the new group in the memberOf attribute in syncope. The 'delete' of a user from the group should work the same way right ? Here are my thoughts on the approaches:
1. user doesn't verify conditions anymore --> syncope user will be deleted
2. user verifies conditions --> no action performed (memberOf attribute of the user in syncope will be updated if it's mapped in syncope)
In case of "user IN" we can have the following two actions:1. user doesn't verify conditions --> no action performed2. user verifies conditions --> syncope user will be created/updatedWith "conditions" I mean ldap filters generated from connector configuration parameters (memberships, custom filter, ....).We can change the behavior by updating syncope user every time the conditions are verified. This means to change the code relative to "users OUT" management.It should be possible without specify memberships but by adding a custom search filter.
- I feel registering the group memberships itself is NOT a good idea. Or in other words, we should also have a mechanism where we should be able synch all the users just based on the base context irrespective of the groups they belong to? Is it possible in the current scenario.
Btw, in this case, keeping the code as is, we cannot catch memberOf updates.
- Regarding the approaches you suggested, I feel the first option is better even though it has a limitation( if a user will come into a not synchronized group, changes to user's memberOf attribute won't be synchronized)
I was thinking about performance .... probably what I wrote before is not so true: since, as far as I know, in general groups are much lower than users, including all groups in the DirSync search filter shouldn't be so negative in terms of performance.
- Looking for each modified group is probably be a deviation from the current approach, as current scope of synchronization is limited to the registered groups currently and it's a performance overhead like you mentioned. Or you can give this option also by having another flag? :-)
I will open an issue to schedule this implementation.Any comments about will be appreciated.
If user goes out from a group we can have one of the following actions:Thanks Fabio for the detailed response.
Before discussing about the approach that we should take, can you tell me how it is working when a user is added to a registered group ? It gets synched 'independently' and you can see the new group in the memberOf attribute in syncope. The 'delete' of a user from the group should work the same way right ? Here are my thoughts on the approaches:
1. user doesn't verify conditions anymore --> syncope user will be deleted2. user verifies conditions --> no action performed (memberOf attribute of the user in syncope will be updated if it's mapped in syncope)
In case of "user IN" we can have the following two actions:1. user doesn't verify conditions --> no action performed2. user verifies conditions --> syncope user will be created/updatedWith "conditions" I mean ldap filters generated from connector configuration parameters (memberships, custom filter, ....).We can change the behavior by updating syncope user every time the conditions are verified. This means to change the code relative to "users OUT" management.It should be possible without specify memberships but by adding a custom search filter.
- I feel registering the group memberships itself is NOT a good idea. Or in other words, we should also have a mechanism where we should be able synch all the users just based on the base context irrespective of the groups they belong to? Is it possible in the current scenario.
Btw, in this case, keeping the code as is, we cannot catch memberOf updates.Better approach would have been to have the default behavior not to search/filter based on the membership and use the filter if any one wants to synch only certain groups. By the way, can you give me an example of the custom search filter (with out specifying memberships)?
- Regarding the approaches you suggested, I feel the first option is better even though it has a limitation( if a user will come into a not synchronized group, changes to user's memberOf attribute won't be synchronized)
I was thinking about performance .... probably what I wrote before is not so true: since, as far as I know, in general groups are much lower than users, including all groups in the DirSync search filter shouldn't be so negative in terms of performance.
- Looking for each modified group is probably be a deviation from the current approach, as current scope of synchronization is limited to the registered groups currently and it's a performance overhead like you mentioned. Or you can give this option also by having another flag? :-)
I will open an issue to schedule this implementation.Any comments about will be appreciated.
Ok. Then we can go with the approach 3 itself. With this fix, the memberOf attribute of the user in syncope should get updated when a user is added/removed from a group, even if the group is not registered. Hope my understanding is correct. This is a very critical issue for us and it's reported at the customer environment. Hope we will get a fix soon :-) Please let me know how I can help.
Thanks Fabio. Will wait for the updates from you. Hope you will be applying the fix to the tag as well.
http://syncope.googlecode.com/svn/tags/syncope-0.7RC1/
Thanks Fabio. Will wait for the updates from you. Hope you will be applying the fix to the tag as well.
http://syncope.googlecode.com/svn/tags/syncope-0.7RC1/
-- Francesco Chicchiriccò "Computer Science is no more about computers than astronomy is about telescopes." (E. W. Dijkstra)