使用startTLS {WAR2 Identity Server连接到外部LDAP源

时间:2015-04-22 13:33:16

标签: ssl ldap wso2 openldap wso2is

我们最近将内部ApacheDS嵌入式LDAP服务迁移到WSO2 Identity Server(4.6.0)中的外部OpenLDAP服务器。上个月一直运作良好。

为了进一步保护环境,我创建了一个新的OpenLDAP集群,它强制使用TLS(startTLS)。下面是我的user-mgt.xml文件。我还将OpenLDAP服务器中的cacert.pem导入到两个IS节点上的./resources/security/client-truststore.jks中。

启动时,我收到以下错误:

无法创建与LDAP服务器的连接。错误消息获取连接时出错。 [LDAP:错误代码13 - 需要TLS机密性]

下面是我的user-mgt.xml

            <UserManager>
            <Realm>
                <Configuration>
                        <AddAdmin>true</AddAdmin>
                        <AdminRole>admin</AdminRole>
                        <AdminUser>
                             <UserName>admin</UserName>
                             <Password>SECRET</Password>
                        </AdminUser>
                    <EveryOneRoleName>everyone</EveryOneRoleName> <!-- By default users in this role sees the registry root -->
                    <Property name="dataSource">jdbc/bpsdbq</Property>
                </Configuration>


                <!-- If product is using an external LDAP as the user store in read/write mode, use following user manager
                        In case if user core cache domain is needed to identify uniquely set property <Property name="UserCoreCacheIdentifier">domain</Property>
                -->
                <UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager">
                    <Property name="TenantManager">org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager</Property>
                    <Property name="ConnectionURL">ldap://ourldap.server.com</Property>
                    <Property name="Disabled">false</Property>
                    <Property name="ConnectionName">cn=admin,dc=wso2,dc=org</Property>
                    <Property name="ConnectionPassword">SECRET</Property>
                    <Property name="passwordHashMethod">SHA</Property>
                    <Property name="UserNameListFilter">(objectClass=person)</Property>
                    <Property name="UserEntryObjectClass">inetOrgPerson</Property>
                    <Property name="UserSearchBase">ou=users,dc=wso2,dc=org</Property>
                    <Property name="UserNameSearchFilter">(&amp;(objectClass=person)(cn=?))</Property>
                    <Property name="UserNameAttribute">cn</Property>
                    <Property name="UsernameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
                    <Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
                    <Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
                    <Property name="RolenameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
                    <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
                    <Property name="ReadGroups">true</Property>
                    <Property name="WriteGroups">true</Property>
                    <Property name="EmptyRolesAllowed">false</Property>
                    <Property name="GroupSearchBase">ou=groups,dc=wso2,dc=org</Property>
                    <Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property>
                    <Property name="GroupEntryObjectClass">groupOfNames</Property>
                    <Property name="GroupNameSearchFilter">(&amp;(objectClass=groupOfNames)(cn=?))</Property>
                    <Property name="GroupNameAttribute">cn</Property>
                    <Property name="SharedGroupNameAttribute">cn</Property>
                    <Property name="SharedGroupSearchBase">ou=SharedGroups,dc=wso2,dc=org</Property>
                    <Property name="SharedGroupEntryObjectClass">groupOfNames</Property>
                    <Property name="SharedGroupNameListFilter">(objectClass=groupOfNames)</Property>
                    <Property name="SharedGroupNameSearchFilter">(&amp;(objectClass=groupOfNames)(cn=?))</Property>
                    <Property name="SharedTenantNameListFilter">(objectClass=organizationalUnit)</Property>
                    <Property name="SharedTenantNameAttribute">ou</Property>
                    <Property name="SharedTenantObjectClass">organizationalUnit</Property>
                    <Property name="MembershipAttribute">member</Property>
                    <Property name="UserRolesCacheEnabled">true</Property>
                    <Property name="ReplaceEscapeCharactersAtUserLogin">true</Property>
                    <Property name="MaxRoleNameListLength">100</Property>
                    <Property name="MaxUserNameListLength">100</Property>
                    <Property name="SCIMEnabled">false</Property>
                </UserStoreManager>


                <AuthorizationManager
                    class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager">
                    <Property name="AdminRoleManagementPermissions">/permission</Property>
                    <Property name="AuthorizationCacheEnabled">true</Property>
                </AuthorizationManager>
            </Realm>
        </UserManager>

任何帮助将不胜感激!

谢谢!

1 个答案:

答案 0 :(得分:2)

WSO2IS不支持与startTLS建立联系。你可以找到一个开放的jira。但是,您可以使用普通SSL / TLS进行连接。是..然后您需要将openLDAP证书导入resources/security/client-truststore.jks并连接到openLDAP的SSL LDAPS端口