cancel
Showing results for 
Search instead for 
Did you mean: 

ldap query 'queryGroupsForUser' is not working

slag
Champ in-the-making
Champ in-the-making
I'm running Activiti 5.16.3 with an ldap connection configured.

I noticed that assigning a task to someone else didn't work and started debugging the ldap part.

The ldapsearch <property name="queryGroupsForUser" value="(&amp;(objectClass=groupOfNames)(member={0}))" /> is wrongly implemented
In the ldap server log i noticed this query:   (&(objectClass=inetOrgPerson)(|(givenName=*%sebas%*)(sn=*%sebas%*))).

This query doesn't work because the '%' is added. I guess this is there to have like in a database.

Any idea where i can remove the '%'
7 REPLIES 7

slag
Champ in-the-making
Champ in-the-making
looks like the query itself fell of:
<code>
<property name="queryUserByFullNameLike" value="(&amp;(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
</code>

jbarrez
Star Contributor
Star Contributor
Where did you find this query?

I can only find that query in a test configuration xml, and it the userguide as an example for ApacheDS.

slag
Champ in-the-making
Champ in-the-making
<code>
<property name="queryUserByFullNameLike" value="(&amp;(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
</code>
This is configured in activiti-standalone-context.xml
http://www.activiti.org/userguide/#ldap_configuration (chapter 17.3)
<code>
(&(objectClass=inetOrgPerson)(|(givenName=*%sebas%*)(sn=*%sebas%*)))
</code>
This is the ldapsearch that is performed. It shows the queries in the ldaplog.
We are using openldap.

jbarrez
Star Contributor
Star Contributor
Sure, but this is just an example. You are supposed to change it to your LDAP system. LDAP queries are not portable between systems

slag
Champ in-the-making
Champ in-the-making
I did change the ldap query and it works in an ldap browser.
The Issue i have is that activiti adds a "%" signs to my query.

"*" is the wildcard character in LDAP.
My query contains: *{1}*. This should result in *sebas*.
The result however according to the log on the ldap server is *%sebas%*

I think that activiti adds the "%" since it is the wildcard for MYSQL.

For the record: this the the query i have configured in activiti-standalone-context.xml
<code>
"(&amp;(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))"
</code>
As you can see there is no "%" sign in my query

The result on the ldap server is:
<code>
(&(objectClass=inetOrgPerson)(|(givenName=*%sebas%*)(sn=*%sebas%*)))
</code>
As you can see a % sign is added.

slag
Champ in-the-making
Champ in-the-making
I think i bumped into this bug.
http://forums.activiti.org/content/user-form-type-does-not-show-users-when-using-ldap

I will further investigate.

slag
Champ in-the-making
Champ in-the-making
You can close this thread.
It should be fixed in later versions.