I am trying to add a user to Active Directory. I mean:
- Using SSL
- Certificate ok
- Password works fine
If there is no group association, the user will be created correctly.
When I try to associate a user with a group, I get the following error:
javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 0000209A: SvcErr: DSID-031A1021, issue 5003 (WILL_NOT_PERFORM), data 0
I used the group attributes DN and NAME, but no one worked. My code is:
ctx = getContext(); ctx.createSubcontext(entryDN,entry); // it works fine Attribute memberOf1 = new BasicAttribute("memberOf","NAME_OF_THE_GROUP"); Attributes atts = new BasicAttributes(); atts.put(memberOf1); ctx.modifyAttributes(entryDN, LdapContext.ADD_ATTRIBUTE, atts); //
I tried LdapContext.ADD_ATTRIBUTE and LdapContext.REPLACE_ATTRIBUTE. In addition, I tried to add a group with other attributes, but the whole situation gave me the same error.
Does anyone know what is going on?
Hooray!
java active-directory ldap
Italo st
source share