首页 文章

wso2是辅助用户存储验证

提问于
浏览
1

我在Debian上有一个wso2是5.1.0服务器runign . 我有一个简单的servlet,它使用Oauth2进行身份验证,并与主存储中的用户完美配合 .

我创建了一个指向openldap服务器的辅助存储 . 我有一些用户和组,从IS可以正确看到 . 我看到,当我尝试查看用户配置文件时,我收到以下错误:

Error while loading user profile metadata

但是当我尝试使用ldap服务器中的用户进行身份验证时,我收到登录失败错误 . 我曾尝试使用用户名,DOMAIN /用户名和用户名@ DOMAIN,但没有一个工作 .

我开始认为它可能与Calim配置有关,因为不同商店中的用户具有不同的值但我不知道如何解决它 .

关于我做错了什么的任何想法?

更新:

这就是我定义二级商店的方式 .

<?xml version="1.0" encoding="UTF-8"?><UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager">
      <Property name="ConnectionURL">ldap://xxxx:389</Property>
      <Property name="ConnectionName">cn=admin,dc=xx,dc=xx</Property>
      <Property encrypted="true" name="ConnectionPassword">xxxx</Property>
      <Property name="UserSearchBase">ou=users,dc=nextel,dc=es</Property>
      <Property name="UserEntryObjectClass">inetOrgPerson</Property>
      <Property name="UserNameAttribute">cn</Property>
      <Property name="UserNameSearchFilter">(&amp;(objectClass=person)cn=?))</Property>
      <Property name="UserNameListFilter">(objectClass=person)</Property>
      <Property name="UserDNPattern"/>
      <Property name="DisplayNameAttribute"/>
      <Property name="Disabled">false</Property>
      <Property name="ReadGroups">true</Property>
      <Property name="WriteGroups">true</Property>
      <Property name="GroupSearchBase">ou=groups,dc=xx,dc=xx</Property>
      <Property name="GroupEntryObjectClass">groupOfNames</Property>
      <Property name="GroupNameAttribute">cn</Property>
      <Property name="GroupNameSearchFilter">(&amp;(objectClass=groupOfNames)(cn=?))</Property>
      <Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property>
      <Property name="RoleDNPattern"/>
      <Property name="MembershipAttribute">member</Property>
      <Property name="MemberOfAttribute"/>
      <Property name="BackLinksEnabled">false</Property>
      <Property name="UserNameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
      <Property name="UserNameJavaScriptRegEx">^[\S]{3,30}$</Property>
      <Property name="UsernameJavaRegExViolationErrorMsg">Username pattern policy violated.</Property>
      <Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
      <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
      <Property name="PasswordJavaRegExViolationErrorMsg">Password pattern policy violated.</Property>
      <Property name="RoleNameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
      <Property name="RoleNameJavaScriptRegEx">^[\S]{3,30}$</Property>
      <Property name="SCIMEnabled">false</Property>
      <Property name="BulkImportSupported">true</Property>
      <Property name="EmptyRolesAllowed">true</Property>
      <Property name="PasswordHashMethod">PLAIN_TEXT</Property>
      <Property name="MultiAttributeSeparator">,</Property>
      <Property name="MaxUserNameListLength">100</Property>
      <Property name="MaxRoleNameListLength">100</Property>
      <Property name="kdcEnabled">false</Property>
      <Property name="defaultRealmName">WSO2.ORG</Property>
      <Property name="UserRolesCacheEnabled">true</Property>
      <Property name="ConnectionPoolingEnabled">false</Property>
      <Property name="ReadTimeout">5000</Property>
      <Property name="LDAPConnectionTimeout">5000</Property>
      <Property name="RetryAttempts">0</Property>
      <Property name="DomainName">incloudLDAP</Property>
      <Property name="Description"/>
</UserStoreManager>

我可以看到列表中的用户,甚至通过WSO2 Is在LDAP上创建一个新用户,但我看不到参数 .

更新:

LDAP中的用户结构非常简单 .

enter image description here

1 回答

  • 1

    对于身份验证问题,您需要验证是否正确配置了“UserNameSearchFilter”属性 . 它必须映射到ladp服务器中的用户名属性 .

    <Property name="UserNameSearchFilter">(&amp;(objectClass=user)(cn=?))</Property>
    

    您还可以将来自不同用户商店的属性映射到相同的wso2声明 . 在映射的attibute部分使用如下的内容,

    PRIMARY/attribute1;FOO/attribute2;BAR/attribute3
    

    也参考 - https://docs.wso2.com/display/IS510/Adding+Claim+Mapping

相关问题