cancel
Showing results for 
Search instead for 
Did you mean: 

configuring ldap

slag
Champ in-the-making
Champ in-the-making
I'm trying to connect activiti 5.17.0 to my ldap server.

According to the documentation (http://www.activiti.org/userguide/) I need to modify activiti-standalone-context.xml.
This file is however not present in after version 5.16.4.


I added the following configuration to activiti-custom-context.xml.

  <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
        <property name="dataSource" ref="dataSource" />
        <property name="transactionManager" ref="transactionManager" />
        <property name="databaseSchemaUpdate" value="true" />
        <property name="jobExecutorActivate" value="true" />
        <property name="enableDatabaseEventLogging" value="true" />
        <property name="customFormTypes">
          <list>
            <bean class="org.activiti.explorer.form.UserFormType"/>
            <bean class="org.activiti.explorer.form.ProcessDefinitionFormType"/>
            <bean class="org.activiti.explorer.form.MonthFormType"/>
          </list>
        </property>

      <property name="configurators">
          <list>
              <bean class="org.activiti.ldap.LDAPConfigurator">
                <!– Server connection params –>
                <property name="server" value="192.168.1.106" />
                <property name="port" value="389" />
                <property name="user" value="uid=admin,dc=newtec,dc=eu" />
                <property name="password" value="secret" />
                <!– Query params –>
                <property name="baseDn" value="ou=people,ou=intranet,dc=newtec,dc=eu" />
                <property name="queryUserByUserId" value="(&amp;(objectClass=inetOrgPerson)(uid={0}))" />
                <property name="queryUserByFullNameLike" value="(&amp;(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
                <property name="queryGroupsForUser" value="(&amp;(objectClass=groupOfNames)(Member={0}))" />
                <!– Attribute config –>
                <property name="userIdAttribute" value="uid" />
                <property name="userFirstNameAttribute" value="cn" />
                <property name="userLastNameAttribute" value="sn" />
                <property name="groupIdAttribute" value="cn" />
                <property name="groupNameAttribute" value="cn" />
             </bean>
          </list>
        </property>
  </bean>


and the following to 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>admin</value>
       </list>
    </property>
    <property name="userGroups">
      <list>
        <value>user</value>
      </list>
    </property>
  </bean>


At startup i get the following error in catalina.out which results in explorer not running.

12:06:39,725 [localhost-startStop-1] INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader  - Loading XML bean definitions from class path resource [activiti-ui-context.xml]
12:06:39,897 [localhost-startStop-1] INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader  - Loading XML bean definitions from class path resource [activiti-login-context.xml]
12:06:39,932 [localhost-startStop-1] INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader  - Loading XML bean definitions from class path resource [activiti-custom-context.xml]
23-Mar-2015 12:06:39.964 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Error listenerStart
23-Mar-2015 12:06:39.977 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/activiti-explorer] startup failed due to previous errors
12:06:39,980 [localhost-startStop-1] INFO  org.activiti.explorer.servlet.WebConfigurer  - Destroying Web application


When i remove the LDAP part from activiti-custom-context.xml it starts up normal.

Any help is welcome.
31 REPLIES 31

slag
Champ in-the-making
Champ in-the-making
I got it working with asriharikiran is config.
I had to place the ldap connectors in the explorer lib folder AND rest lib folder.

I did run into an old bug:
assigning a task to a user does the following ldap query:
<code>
SRCH base="ou=intranet,dc=newtec,dc=eu" scope=2 deref=3 filter="(&(objectClass=inetOrgPerson)(|(givenName=*%seba%*)(sn=*%seba%*)))"
</code>
In my custom.xml i have the following line:
<code>
<property name="queryUserByFullNameLike" value="(&amp;(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
</code>

The '%' that is added is from the sql query like. this should be replaced by a * in ldap.
http://forums.activiti.org/content/user-form-type-does-not-show-users-when-using-ldap

andre1
Champ in-the-making
Champ in-the-making
Hi,

I was trying to follow the instructions for the LDAP integration (http://www.activiti.org/userguide/#chapter_ldap) and I have my activiti-custom-context.xml like this:

<code>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:jee="http://www.springframework.org/schema/jee" xmlns:aop="http://www.springframework.org/schema/aop"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
       http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">

       <property name="configurators">
                 <list>

<bean class="org.activiti.ldap.LDAPConfigurator">
                <!– Server connection params –>
                <property name="server" value="ldap://1.2.3.4" />
                <property name="port" value="389" />
                <property name="user" value="CN=Administrator,CN=Users,DC=test,DC=test,DC=com" />
                <property name="password" value="*******" />

                <!– Query params –>
                <property name="baseDn" value="OU=test group,OU=test test,OU=test,DC=teste,DC=test,DC=com" />
                <property name="queryUserByUserId" value="(&amp;(objectClass=person)(sAMAccountName={0}))" />
            <property name="queryGroupsForUser" value="(&amp;(objectClass=group)(member={0}))"/>

                <!– Attribute config –>
                <property name="userIdAttribute" value="sAMAccountName" />
                <property name="userFirstNameAttribute" value="givenName" />
                <property name="userLastNameAttribute" value="sn" />
                <property name="groupIdAttribute" value="cn" />
                <property name="groupNameAttribute" value="cn" />

                <property name="customConnectionParameters">
    <map>
     <entry key="Context.REFERRAL" value="follow" />

    </map>
   </property>

</bean>
</list>
    </property>
</beans>
</code>

but in the logs it gives me the following message:

<code>
Apr 11, 2016 12:11:51 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat/webapps/activiti-explorer.war
Apr 11, 2016 12:11:57 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Apr 11, 2016 12:11:57 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/activiti-explorer] startup failed due to previous error
</code>

If I remove the tags <property name="configurators"> and <list> no error is given but can't login with ldap credentials.
What am I doing wrong ?

Thanks in advance