简体   繁体   中英

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. 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. However, I keep getting an error forgotPassword: attribute type undefined .

如果条目尚不具有该属性,则replace修改类型将为该条目添加属性,但是该属性类型需要在架构中定义,并由条目中包含的对象类允许。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM