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

jbarrez
Star Contributor
Star Contributor
> But without success

There are people here on the forum who posted how they made it work with the custom xml, so it's possible for sure.

hari
Star Contributor
Star Contributor
Slag,

I am trying to integrate LDAP and was going through this thread.
I have a quick question for you.
Do you have activiti-ldap-5.17.0 in Apache tomcat lib folder ?

Regards,
Hari.

slag
Champ in-the-making
Champ in-the-making
@jbarrez
> There are people here on the forum who posted how they made it work with the custom xml, so it's possible for sure.
could you point me in the correct direction?
@B.Schnarr
> have you tried the link in your ticket?
@asriharikiran
Although the activiti-explorer lib folder is sufficient no harm in putting it in the tomcat lib folder.
The tomcat lib folder is system wide, the activiti-explorer lib folder is only used by activiti-explorer.

emihernandez
Champ in-the-making
Champ in-the-making
Hello, how are you?

I can see that the user guide isn't up to date. Could you update it or give us here a guide of how integrate ldap in activiti 5.17.0?
The problem is that the file activiti-standalone-context.xml doesn't exist any more, I also tried uncommenting the xml in activiti-custom-context.xml but then, the application won´t boot up again.

I read this in other post:
"I used the example in the sample application "activiti-webapp-rest2" to define all engine specific configuration in ActivitiEngineConfiguration class. The beans defined in this class are loaded when spring context is initialized just like the xml file. Not sure about issue with activiti-custom-context.xml, as I dint try it."

But I don't understand how can I modify the ActivitiEngineConfiguration in order to load my ldap configuration (server url, port, queries, etc).

I would appreciate any help.

hari
Star Contributor
Star Contributor
Guys,

With LDAP configured, I was able to start tomcat and Activiti-Explorer was up.
Now I have a different issue. 
No matter which user I try with, activiti-explorer always says invalid credentials.

I am attaching a Java file here with which I am validating if my credentials are valid or not.
When I run the java file, my credentials work perfectly fine.

I am also attaching the LDIF file for your reference.

Can some one tell me whats going wrong in my case?

b_schnarr
Champ in-the-making
Champ in-the-making
I agree with emihernandez, updating the user guide for 5.17 concerning LDAP-config would be very helpful.

hari
Star Contributor
Star Contributor
Missed attaching the UI and custom context xml files in my above post.
So here I am attaching them.

Regards,
Hari.

hari
Star Contributor
Star Contributor
I too would like to have the user guide updated with LDAP integration information.

Regards,
Hari.

hari
Star Contributor
Star Contributor
The issue for me was that the mail was not configured in ldap and hence the login was failing.  Either removing the mail tag or adding the mail attribute to ldap got it working.
Also the group names in activiti-ui-context.xml were incorrect.

jbarrez
Star Contributor
Star Contributor
@asriharikiran : many thanks for sharing this example. I'm sure it will help many people.

We will update the user guide in the near future, but currently the work on Activiti 6 as taking up most our time, as we're launching next week at our community event.