LDAP auth problem against Zimbra LDAP

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
maxxer
Posts: 33
Joined: Tue Apr 20, 2010 6:35 pm

LDAP auth problem against Zimbra LDAP

Post by maxxer »

Hi.

I am trying to configure LDAP auth, but I failed so far.

I changed config in config/ldap.php, adapted config/constants_ldap.php but no luck.

I am trying to authenticate to a Zimbra LDAP server.
The auth strings can be checked here:
http://www.zimbra.com/forums/administra ... post176605

My ldap.conf

Code: Select all

<?php
$PMF_LDAP["ldap_server"] = 'localhost';
$PMF_LDAP["ldap_port"] = '389';
$PMF_LDAP["ldap_user"] = 'uid=zimbra,cn=admins,cn=zimbra';
$PMF_LDAP["ldap_password"] = 'zimbraldappass';
$PMF_LDAP["ldap_base"] = 'ou=people,dc=mydomain,dc=mytld';
in constants_ldap.php I had to change

Code: Select all

$PMF_LDAP['ldap_mapping'] = array (
    'name'     => 'cn',
    'username' => 'uid',
    'mail'     => 'mail');
When I try to login using a user present in Zimbra, I get the following error in PMF

Code: Select all

phpMyFAQ warning [2]: ldap_bind() [function.ldap-bind]: Unable to bind to server: Invalid DN syntax in Ldap.php on line 104
I tried using the patched version from here http://github.com/thorsten/phpMyFAQ/com ... 1d061f30c7 but it just doesn't spit out the error, auth still fails (silently).

What can be wrong?
Thanks

P.S. phpMyFAQ 2.6.4
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP auth problem against Zimbra LDAP

Post by Thorsten »

Hi,

do you have error logs from your LDAP server? Then we can check why we generate a wrong DN syntax.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
maxxer
Posts: 33
Joined: Tue Apr 20, 2010 6:35 pm

Re: LDAP auth problem against Zimbra LDAP

Post by maxxer »

I still have to figure out how to get those info from the server, now I got the following error:

Code: Select all

phpMyFAQ warning [2]: ldap_get_values(): supplied argument is not a valid ldap result entry resource in Ldap.php on line 181
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP auth problem against Zimbra LDAP

Post by Thorsten »

Hi,

looks like something's wrong while getting the data from LDAP.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
maxxer
Posts: 33
Joined: Tue Apr 20, 2010 6:35 pm

Re: LDAP auth problem against Zimbra LDAP

Post by maxxer »

Ok, I checked into LDAP's log and found that I needed to enter the login as full email...

Now, if I try to login with the full email address, bind is OK, but yet PMF says:

Code: Select all

phpMyFAQ warning [2]: ldap_get_values(): supplied argument is not a valid ldap result entry resource in Ldap.php on line 181
how can I debug this?
thanks
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP auth problem against Zimbra LDAP

Post by Thorsten »

Hi,

I need the debug log otherwise it will be hard to debug...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
maxxer
Posts: 33
Joined: Tue Apr 20, 2010 6:35 pm

Re: LDAP auth problem against Zimbra LDAP

Post by maxxer »

Thorsten wrote:I need the debug log otherwise it will be hard to debug...

thanks for your reply.

debug log of PMQ? How do I generate it?
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP auth problem against Zimbra LDAP

Post by Thorsten »

Hi,

no, the debug or error log of your LDAP server.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
maxxer
Posts: 33
Joined: Tue Apr 20, 2010 6:35 pm

Re: LDAP auth problem against Zimbra LDAP

Post by maxxer »

this is what i get on ldap:

Code: Select all

slapd[3093]: conn=121804 fd=29 ACCEPT from IP=10.11.12.190:51232 (IP=10.11.12.190:389) 
slapd[3093]: conn=121804 op=0 BIND dn="uid=zimbra,cn=admins,cn=zimbra" method=128 
slapd[3093]: conn=121804 op=0 BIND dn="uid=zimbra,cn=admins,cn=zimbra" mech=SIMPLE ssf=0 
slapd[3093]: conn=121804 op=0 RESULT tag=97 err=0 text= 
slapd[3093]: conn=121804 op=1 SRCH base="ou=people,dc=mydomain,dc=it" scope=2 deref=0 filter="(uid=lorenzo.milesi@mydomain.it)" 
slapd[3093]: conn=121804 op=1 SRCH attr=cn 
slapd[3093]: conn=121804 op=1 SEARCH RESULT tag=101 err=0 nentries=0 text= 
slapd[3093]: conn=121804 op=2 UNBIND 
slapd[3093]: conn=121804 fd=29 closed 
maxxer
Posts: 33
Joined: Tue Apr 20, 2010 6:35 pm

Re: LDAP auth problem against Zimbra LDAP

Post by maxxer »

Ok, I fixed by changing

$PMF_LDAP['ldap_use_domain_prefix'] = false;
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP auth problem against Zimbra LDAP

Post by Thorsten »

Hi,

thanks for the feedback!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply