上WSO2 5.3.0 Identity Server的LDAP用户创建
问题描述:
我使用WSO2的Identity Server 5.3.0 使用基于OpenLDAP的二次userstore 外部LDAP Person类是eduPerson因为它是在 https://www.internet2.edu/media/medialibrary/2013/09/04/internet2-mace-dir-eduperson-201203.html上WSO2 5.3.0 Identity Server的LDAP用户创建
指定使用辅助模式的类被定义为辅助
当我试图添加我得到
用户[LDAP:错误代码65 - 没有提供结构对象类]。
在配置
<Property name="UserEntryObjectClass">eduPerson</Property>
完整的轨迹是下面
Caused by: javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - no structural object class provided]; remaining name 'uid=testy'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3167)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3082)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2888)
at com.sun.jndi.ldap.LdapCtx.c_bind(LdapCtx.java:423)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_bind(ComponentDirContext.java:299)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.bind(PartialCompositeDirContext.java:217)
at org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager.doAddUser(ReadWriteLDAPUserStoreManager.java:275)
... 71 more
任何人可以在帮助呢?
答
解决
将溶液使用如分隔符/添加更多UserEntryObject类,因为它是在类ReadWriteLDAPUserStoreManager描述
protected BasicAttributes getAddUserBasicAttributes(String userName) {
BasicAttributes basicAttributes = new BasicAttributes(true);
String userEntryObjectClassProperty = realmConfig
.getUserStoreProperty(LDAPConstants.USER_ENTRY_OBJECT_CLASS);
BasicAttribute objectClass = new BasicAttribute(LDAPConstants.OBJECT_CLASS_NAME);
String[] objectClassHierarchy = userEntryObjectClassProperty.split("/");
for (String userObjectClass : objectClassHierarchy) {
if (userObjectClass != null && !userObjectClass.trim().equals("")) {
objectClass.add(userObjectClass.trim());