如何配置 activiti.org 以使用 IBM Domino LDAP 组

How to config activiti.org to work with IBM Domino LDAP groups

我致力于将 IBM Domino 与 activiti.org 工作流引擎集成。我需要将 Activiti 与 Domino LDAP 连接起来以检索用户和组。
我已经可以使用我的 Domino 凭据登录,但我无法解析用户组。我的用户是 ACTIVITI_ADMINS 多米诺骨牌组的成员,但他没有看到 activiti-explorer 管理菜单(默认 kermit用户看到)。我在 Activiti xml 配置文件中做了以下修改。为了解析用户组,我应该 add/rewrite 在我的配置文件中做什么?

activiti-自定义-context.xml

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
    <!--...-->
    <property name="configurators">
        <list>
            <bean class="org.activiti.ldap.LDAPConfigurator">
                <!-- Server connection params -->
                <property name="server" value="ldap://myDominoLdapServer" />
                <property name="port" value="389" />                
                <property name="user" value="cn=User Ldap, ou=myUnit1, ou=myUnit2, o=myCompany" />
                <property name="password" value="myPassword" />
                <!-- Query params -->                
                <property name="baseDn" value="o=myCompany" />      
                <property name="queryUserByUserId" value="(&amp;(objectClass=inetOrgPerson)(displayname={0}))" />
                <property name="queryUserByFullNameLike" value="(&amp;(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
                <property name="queryGroupsForUser" value="(&amp;(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />        
                <!-- Attribute config -->       
                <property name="userIdAttribute" value="displayname" />
                <property name="userFirstNameAttribute" value="GivenName" />
                <property name="userLastNameAttribute" value="sn" />
                <property name="userEmailAttribute" value="mail" />
                <property name="groupIdAttribute" value="cn" />
                <property name="groupNameAttribute" value="cn" />
            </bean>
        </list>
    </property>
</bean>

activiti-ui-context.xml

<bean name="explorerApp" class="org.activiti.explorer.ExplorerApp" scope="session">
    <property name="environment" value="${activiti.ui.environment}" />
    <property name="useJavascriptDiagram" value="${activiti.ui.jsdiagram}" />
    <property name="i18nManager" ref="i18nManager" />
    <property name="viewManager" ref="viewManager" />
    <property name="notificationManager" ref="notificationManager" />
    <property name="attachmentRendererManager" ref="attachmentRendererManager" />
    <property name="formPropertyRendererManager" ref="formPropertyRendererManager" />
    <property name="variableRendererManager" ref="variableRendererManager" />
    <property name="applicationMainWindow" ref="mainWindow" />
    <property name="componentFactories" ref="componentFactories" />
    <property name="workflowDefinitionConversionFactory" ref="workflowDefinitionConversionFactory" />
    <property name="loginHandler" ref="activitiLoginHandler" />
    <property name="simpleWorkflowJsonConverter" ref="simpleWorkflowJsonConverter" />
    <property name="adminGroups">
        <list>      
            <value>ACTIVITI_ADMINS</value>
        </list>
    </property>
    <property name="userGroups">
        <list>
            <value>user</value>
        </list>
    </property>
</bean>

您的配置看起来正确,因此问题一定与用于检索用户组的 LDAP 查询有关:

<property name="queryGroupsForUser" value="(&amp;(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />

此查询是否返回 ACTIVITI_ADMIN 组?

好吧,我发现 baseDN 条目是我遇到问题的原因。我设置了空值,Activiti 现在正在解析我的组。 activiti-custom-context.xml 文件包含以下代码:

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
    <!--...-->
    <property name="configurators">
        <list>
            <bean class="org.activiti.ldap.LDAPConfigurator">
                <!-- Server connection params -->
                <property name="server" value="ldap://myDominoLdapServer" />
                <property name="port" value="389" />                
                <property name="user" value="cn=User Ldap, ou=myUnit1, ou=myUnit2, o=myCompany" />
                <property name="password" value="myPassword" />
                <!-- Query params -->              
                <!--MY CHANGE START-->  
                <property name="baseDn" value="" />
                <!--MY CHANGE END-->  
                <property name="queryUserByUserId" value="(&amp;(objectClass=inetOrgPerson)(displayname={0}))" />
                <property name="queryUserByFullNameLike" value="(&amp;(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
                <property name="queryGroupsForUser" value="(&amp;(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />        
                <!-- Attribute config -->       
                <property name="userIdAttribute" value="displayname" />
                <property name="userFirstNameAttribute" value="GivenName" />
                <property name="userLastNameAttribute" value="sn" />
                <property name="userEmailAttribute" value="mail" />
                <property name="groupIdAttribute" value="cn" />
                <property name="groupNameAttribute" value="cn" />
            </bean>
        </list>
    </property>
</bean>