首先:如果您在 Ubuntu 16.04 上使用默认 OpenLdap 配置,则必须使用服务器 root 帐户的本地工具。例如:
root@OpenLdap1:ldapadd -Y EXTERNAL -H ldapi:/// -f identityPerson.ldif
您可以看到 cn=config 的访问列表是:
# {0}config, config
dn: olcDatabase={0}config,cn=config
objectClass: olcDatabaseConfig
olcDatabase: {0}config
olcAccess: {0}to * by dn.exact=gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth manage by * break
第二:你必须修改 wso2 给出的 ldif 文件。在 OpenLdap 中,模式被表示为单独的 LDAP 对象,因此您必须创建一个新条目,而不是修改对象。语法上还有一个区别——你应该用 olcAttributeTypes 替换 attributeTypes,用 olcobjectClasses 替换 objectClasses。你的 wso2Person.ldif 看起来像:
dn: cn=wso2Person,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: wso2Person
olcAttributeTypes: ( 1.3.6.1.4.1.37505.1.2
NAME 'gender'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
....
olcAttributeTypes: ( 1.3.6.1.4.1.37505.1.13
NAME 'prefferedLanguage'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
olcobjectClasses: ( 1.3.6.1.4.1.37505.1.1
NAME 'wso2Person'
DESC 'wso2Person'
SUP inetOrgPerson
STRUCTURAL
MAY ( gender $ country $ nickName $ timeZone $ dateOfBirth $ role $ im $ url $ otherPhone $ privatePersonalIdentifier $ profileconfiguration $ prefferedLanguage)
)
wso2 类也有结构依赖,所以它们的添加顺序很重要:
ldapadd -Y EXTERNAL -H ldapi:/// -f wso2Person.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f scimPerson.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f identityPerson.ldif