Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an LDAP server runs on:
ldap://129.168.0.117:389
or
ldap://roshd.org:389 where roshd.org = 129.168.0.117

I have this configuration in config.php in phpldapadmin:


$servers = new Datastore();
$servers->newServer('ldap_pla');
$servers->setValue('server','name','My LDAP Server');
$servers->setValue('server','host','192.168.0.117');
$servers->setValue('server','port',389);
$servers->setValue('login','auth_type','session');
$servers->setValue('login','bind_id','cn=Manager,dc=roshd,dc=org');
$servers->setValue('login','bind_pass','secret');
$servers->setValue('auto_number','search_base','ou=People,dc=roshd,dc=org');


in my sldap.conf:


...
database    bdb
directory   /usr/local/var/openldap-data
suffix      "dc=roshd,dc=org"
rootdn      "cn=Manager,dc=roshd,dc=org"
rootpw      secret
...

but when I attemp to login in phpldapadmin, I got this error. is there any idea?


Unable to connect to LDAP server My LDAP Server
Error: Can't contact LDAP server (-1) for user
error   Failed to Authenticate to server
Invalid Username or Password.

share|improve this question
1  
+1 for a well written question! –  geoffc Jan 23 '11 at 19:20
    
Did you ever resolve this? –  Cerin Mar 22 '11 at 20:44
    
@Chris : no I just install iRedmail CentOS and use it's preconfigured OpenLDAP –  Mohammad Ali Akbari Mar 25 '11 at 14:40
add comment

3 Answers

up vote 1 down vote accepted

Spot the difference:

$servers->setValue('server','host','192.168.0.117');

ldap://129.168.0.117:389

share|improve this answer
add comment

I suspect that the rootpw is either expected to be stored encrypted, and you have it clear text, in which case it is expecting perhaps a different result. (I.e. The hashed value of secret is being sent and being compared to the clear text string secret.)

share|improve this answer
1  
I think no, there is another option for SASL Authentication in config.php, but I will try it –  Mohammad Ali Akbari Jan 23 '11 at 19:53
add comment

If you are authenticating against ldap itself, you might want to check this setting: $servers->setValue('login','attr','uid');

/* If you specified 'cookie' or 'session' as the auth_type above, you can
   optionally specify here an attribute to use when logging in. If you enter
   'uid' and login as 'dsmith', phpLDAPadmin will search for (uid=dsmith)
   and log in as that user.
   Leave blank or specify 'dn' to use full DN for logging in. Note also that if
   your LDAP server requires you to login to perform searches, you can enter the
   DN to use when searching in 'bind_id' and 'bind_pass' above. */
// $servers->setValue('login','attr','dn');
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.