i'm trying to modify a existing user and add a attribute to him. I'm using the following code:
Attributes attrs1 = new BasicAttributes(true);
attrs1.put("proxyHash", generateProxyHash(account, "123456"));
ldapContext.modifyAttributes(username, DirContext.ADD_ATTRIBUTE,attrs1);
But i've received an exception t开发者_开发知识库hat says 'the attribute proxyHash is not allowed'
Thansks
Joao Carlos found solution himself:
The user I was trying to change was in a different schema, this schema haven't the attribute specified. After this fix the code works.
Unless the entry username
has the objectClass extensibleObject
or the objectClass that requires or allows the proxyHash
attribute the directory server must reject the attempt to add proxyHash
to the entry.
精彩评论