使用WSO2 Identity Server配置外部LDAP用户存储

时间:2012-09-14 12:10:05

标签: openldap wso2carbon

我的当前配置

 <UserManager>
    <Realm>
        <Configuration>
                <AdminRole>admin</AdminRole> 
                <AdminUser>
                     <UserName>admin</UserName>
                     <Password>XXXXXX</Password>
                </AdminUser>
            <EveryOneRoleName>everyone</EveryOneRoleName> <!-- By default users in     thsi role sees the registry root -->
<!--            <ReadOnly>false</ReadOnly> -->
            <MaxUserNameListLength>500</MaxUserNameListLength>
            <Property name="url">jdbc:h2:repository/database/WSO2CARBON_DB</Property>
            <Property name="userName">wso2carbon</Property>
            <Property name="password">wso2carbon</Property>
            <Property name="driverName">org.h2.Driver</Property>
            <Property name="maxActive">50</Property>
            <Property name="maxWait">60000</Property>
            <Property name="minIdle">5</Property>
        </Configuration>
        <UserStoreManager
            class="org.wso2.carbon.user.core.ldap.LDAPUserStoreManager">
            <Property name="ConnectionURL">ldap://localhost:389</Property>
            <Property name="ConnectionName">cn=admin,dc=ysd,dc=com</Property>
            <Property name="ConnectionPassword">admin32</Property>
            <Property name="UserSearchBase">ou=People,dc=ysd,dc=com</Property>
            <Property name="UserNameListFilter">(objectClass=person)</Property>
            <Property name="UserNameAttribute">uid</Property>
            <Property name="ReadLDAPGroups">false</Property>
            <Property name="GroupSearchBase">ou=People,dc=ysd,dc=com</Property>
            <Property name="GroupSearchFilter">(objectClass=groupOfNames)</Property>
            <Property name="GroupNameAttribute">cn</Property>
            <Property name="MembershipAttribute">member</Property>
        </UserStoreManager>
        <AuthorizationManager
            class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager">
        </AuthorizationManager>
    </Realm>
</UserManager>`

启动服务器时出现以下错误。 * 错误{org.wso2.carbon.user.core.common.DefaultRealm} - 无法创建org.wso2.carbon.user.core.ldap.LDAPUserStoreManager。错误是:null java.lang.reflect.InvocationTargetException * .............. ............ ............

引起:org.wso2.carbon.user.core.UserStoreException:LDAPUserStoreManager无法在读写模式下运行。这是无效的配置。它只能在ReadOnly模式下运行         在org.wso2.carbon.user.core.ldap.LDAPUserStoreManager。(LDAPUserStoreManager.java:97)         ......还有25个

1 个答案:

答案 0 :(得分:1)

您的确切要求是什么?您是否希望Identity Server在外部LDAP上执行读写操作,或者您是否只想执行读取操作?

您遇到此异常,因为您尝试将只读ldap用户存储用于两个读写操作。将参数<ReadOnly>false</ReadOnly>设置为true,然后此错误就会消失。

但是如果您的要求是使用IS进行两次读写操作,请使用ApacheDSUserStoreManager。您可以使用LDAPUserStoreManager。