将WSO2 Identity Server默认架构导入OpenLDAP



我正在尝试使用OpenLDAP作为主用户存储来设置WSO2 Identity服务器。我想将Idp嵌入式ApacheDS模式":wso2Person、identityPerson和scimPerson添加到OpenLDAP中,但我既不能导入该模式,也不能导入wso2Person、identity Person和scimPerson ldif文件。

你能提供一个如何实现这个目标的例子吗?

我正试图使用ApacheDS-Studio或其他LDAP客户端将文件导入Ubuntu Server 16 LTS上的新OpenLDAP,但每次尝试导入文件时都会引发错误。

I。E.:启动

sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f ou=schema.ldif

服务器响应:

服务器不愿意执行(53)没有全局高级知识

或者,尝试导入wso2Person.ldif

ldapadd -D ldap:/// -D "cn=admin,dc=example,dc=org" -x -W -f wso2Person.ldif

抛出以下错误:

无效语法(21)附加信息:attributeTypes:值#0每个语法无效

没有必要使用wso2Person模式。您可以使用外部ldap支持的任何模式(例如:inetOrgPerson)。您只需要为openldap模式中具有现有属性的属性进行声明映射。您可以在"下的"配置->索赔管理"选项卡中找到此索赔http://wso2.org/claims".您可以编辑ldap服务器中具有现有属性的每个属性的声明映射[1]。例如:第一个名称映射到主用户存储中的属性"givenName"。Openldap还支持"givenName"属性类型。因此您不必更改这些属性。但很少有像"Last name"这样的属性映射到"sn"在主用户存储中,如果没有将正确的对象类添加到用户组中,则不在默认的openldap中。例如,我使用"displayName"作为辅助用户存储的映射属性。您可以看到如何在附加的图像claims.png中编辑声明(其中NEWTEST是次要用户存储名称)以便添加索赔映射。因此,像这样,您必须将这些属性映射到openldap模式中的现有属性。

[1] -https://docs.wso2.com/display/IS500/Editing+索赔+拨号

首先:如果您在Ubuntu 16.04上使用默认的OpenLdap配置,则必须使用服务器根帐户中的本地工具。例如:

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

第二:您必须修改ldif文件,由wso2提供。在OpenLdap中,模式被表示为单独的LDAP对象,因此您必须创建一个新条目,而不是修改对象。语法上也有一个区别——应该用olcAttributeTypes替换attributeType,用olcojectClasses替换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 

最新更新