You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that DirContextOperations returned by LdapTemplate.lookupContext() doesn't correctly support multi value attributes if the value count exceeds the LDAP fetch limit (1500 in our case).
This will cause AttributeInUseException although addIfDuplicateExists is false if there is a too large amount of users in the group. I assume it's because DirContextOperations didn't receive all values. Maybe it's also related to #561 and existing members won't be loaded at all since the attribute's name changes from "member" to "member;range=0-1499". I couldn't check that yet.
My suggestion would be to add a new LdapTemplate::lookupContext() variant with IncrementalAttributesMapper argument:
But - most importantly - there should be a hint in the documentation, that lookupContext() doesn't support multi value attributes except if you can guarantee that there won't be more values than a single fetch returns.
The text was updated successfully, but these errors were encountered:
I also wonder if other methods like DirContextOperations::removeAttributeValue("member", memberDn) work. It looks as if the code checks whether the attribute value is available. This check has probably the same issue, so the answer will always be no and therfore nothing will be removed.
I find lots of code like that and don't know, what works safely at all. This is a huge problem! It would be great if at least there was a workaround. I wonder if you could replace originalAttrs of DirContextAdapter with a version that contains the missing members, for example.
It seems that
DirContextOperations
returned byLdapTemplate.lookupContext()
doesn't correctly support multi value attributes if the value count exceeds the LDAP fetch limit (1500 in our case).Following code doesn't work as expected:
This will cause
AttributeInUseException
althoughaddIfDuplicateExists
isfalse
if there is a too large amount of users in the group. I assume it's becauseDirContextOperations
didn't receive all values. Maybe it's also related to #561 and existing members won't be loaded at all since the attribute's name changes from "member" to "member;range=0-1499". I couldn't check that yet.My suggestion would be to add a new
LdapTemplate::lookupContext()
variant withIncrementalAttributesMapper
argument:Example usage:
But - most importantly - there should be a hint in the documentation, that
lookupContext()
doesn't support multi value attributes except if you can guarantee that there won't be more values than a single fetch returns.The text was updated successfully, but these errors were encountered: