在内存ldap资源文件中添加自定义属性会出现此错误LDAP-ERROR 82

时间:2019-07-15 10:28:37

标签: spring-mvc ldap openldap in-memory unboundid-ldap-sdk

将此文件导入到内存ldap中时,出现此错误 我正在创建用于剩余API的单元测试的in-memory-ldap,我在inetorgperson.schema文件中添加了一个名为“ userName”的属性, 但是在将样本数据的副本导入此ldif文件时,出现了名为userName is invalid attribute的错误。我也只想将自定义属性userName添加到我的内存ldap中。

//******code ***//
dn: cn=schema
changeType: modify
add: attributeType
attributeType: ( 2.25.1284247924247958458780603.1 NAME 'userName' DESC 'this is user name of the any user which is uniquely identify the user' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

dn: cn=schema
changetype: modify
delete: objectclass
objectclass: ( 2.16.840.1.113730.3.2.2
    NAME 'inetOrgPerson'
    DESC 'RFC2798: Internet Organizational Person'
    SUP organizationalPerson
    STRUCTURAL
    MAY (
        audio $ businessCategory $ carLicense $ departmentNumber $
        displayName $ employeeNumber $ employeeType $ givenName $
        homePhone $ homePostalAddress $ initials $ jpegPhoto $
        labeledURI $ mail $ manager $ mobile $ o $ pager $
        photo $ roomNumber $ secretary $ uid $ userCertificate $
        x500uniqueIdentifier $ preferredLanguage $
        userSMIMECertificate $ userPKCS12 )
    )


dn: cn=schema
changetype: modify
add: objectclass
objectclass: ( 2.16.840.1.113730.3.2.2
    NAME 'inetOrgPerson'
    DESC 'RFC2798: Internet Organizational Person'
    SUP organizationalPerson
    STRUCTURAL
    MUST ( userName )
    MAY (
        audio $ businessCategory $ carLicense $ departmentNumber $
        displayName $ employeeNumber $ employeeType $ givenName $
        homePhone $ homePostalAddress $ initials $ jpegPhoto $
        labeledURI $ mail $ manager $ mobile $ o $ pager $
        photo $ roomNumber $ secretary $ uid $ userCertificate $
        x500uniqueIdentifier $ preferredLanguage $
        userSMIMECertificate $ userPKCS12 )
)

dn: dc=maxcrc,dc=com
objectClass: domain
objectClass: top
dc: maxcrc


dn: o=gslab,dc=maxcrc,dc=com
objectClass: organization
objectClass: top
o: gslab

dn: ou=groups,o=gslab,dc=maxcrc,dc=com
objectClass: organizationalUnit
objectClass: top
ou: groups

dn: cn=Admin,ou=groups,o=gslab,dc=maxcrc,dc=com
objectClass: groupOfNames
objectClass: top
cn: Admin
member: uid=3367ed19-10b4-438c-aae9-71982dc66238,ou=People,o=gslab,dc=maxcrc,dc=com
description: this is the group of Admin users only....

dn: cn=HR11,ou=groups,o=gslab,dc=maxcrc,dc=com
objectClass: groupOfNames
cn: HR11
member: ou=People,o=gslab,dc=maxcrc,dc=com

dn: ou=People,o=gslab,dc=maxcrc,dc=com
objectClass: organizationalUnit
objectClass: top
ou: People
description: Container for user entries

dn: uid=3367ed19-10b4-438c-aae9-71982dc66238,ou=People,o=gslab,dc=maxcrc,dc=com
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
cn: emp21321
sn: emp21321
userName: ak123456
departmentNumber: 12
employeeNumber: 564987
employeeType: SSE
homePhone: 456
homePostalAddress: pune,12345623
initials: EEE
mail: emp123456789@gmail.com
mobile: 45454454544
preferredLanguage: mrt,english
uid: 3367ed19-10b4-438c-aae9-71982dc66238
userPassword:: WW14aFkydHdaV0Z5YkE9PQ==

LDAPException(resultCode = 65(违反对象类),errorMessage ='无法添加条目'uid = 3367ed19-10b4-438c-aae9-71982dc66238,ou = People,o = gslab,dc = maxcrc,dc = com'因为它违反了所提供的架构:该条目包含架构中未定义的userName属性。',ldapSDKVersion = 4.0.9,version = 29290)

0 个答案:

没有答案