[英]ldap unboundid: create custom attribute for an entry
try {
LDAPResult result = getConnection().modify(
"dn: cn=jacob.kranz,cn=example,cn=com",
"changetype: modify",
"replace: forgotPasswordAttribute",
"forgotPasswordAttribute: testValueForNewAttribute");
} catch (LDIFException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (LDAPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
I want to add the forgotPassword attribute for the given entry. 我想为给定的条目添加forgotPassword属性。 According to the UnboundId documenatation (found here ), when doing a replace (see param 3), it will create the attribute if the attribute does not already exist. 根据UnboundId文档(在此处找到),进行替换时(请参阅参数3),如果该属性尚不存在,它将创建该属性。 However, I keep getting an error forgotPassword: attribute type undefined
. 但是,我不断收到错误forgotPassword: attribute type undefined
。
如果条目尚不具有该属性,则replace修改类型将为该条目添加属性,但是该属性类型需要在架构中定义,并由条目中包含的对象类允许。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.