Java LDAP-将组添加到用户问题-错误代码53-WILL_NOT_PERFORM [英] Java LDAP - Add group to user issue - Error code 53 - WILL_NOT_PERFORM

查看:1028
本文介绍了Java LDAP-将组添加到用户问题-错误代码53-WILL_NOT_PERFORM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将用户添加到Active Directory.
注意:

I am trying to add an user into Active Directory.
Having in mind:

  • 使用SSL
  • 证书确定
  • 密码工作正常

在没有组关联的情况下,正确创建了用户.

With out group association, the user is correctly created.

当我尝试将用户关联到组时,出现以下错误:
javax.naming.OperationNotSupportedException:[LDAP:错误代码53-0000209A:SvcErr:DSID-031A1021,问题5003(WILL_NOT_PERFORM),数据0

When I try to associate the user to a group I get the following error:
javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 0000209A: SvcErr: DSID-031A1021, problem 5003 (WILL_NOT_PERFORM), data 0

我使用了DN和NAME组属性,但没有一个起作用. 我的代码是:

I have used the DN and NAME group attributes but none 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); // ## it doesn't work

我尝试了LdapContext.ADD_ATTRIBUTE和LdapContext.REPLACE_ATTRIBUTE. 另外,我尝试添加具有其他属性的组,但所有情况都给了我相同的错误.

I tried LdapContext.ADD_ATTRIBUTE and LdapContext.REPLACE_ATTRIBUTE. Also, I tried to add the group with the other attributes but all situation gave me the same error.

有人知道发生了什么吗?

Does anyone have any idea what is going on?

干杯!

推荐答案

memberOf是构造的属性.您必须将用户添加到组的member属性中,而不是将组添加到用户的memberOf属性中.

memberOf is a constructed attribute. You have to add the user to the group's member property, not add the group to the user's memberOf property.

这篇关于Java LDAP-将组添加到用户问题-错误代码53-WILL_NOT_PERFORM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆