Jump to content

Ldap Bind And Search Confusion


crwork

Recommended Posts

Have a project where I'm trying to connect to an LDAP server with a user and password.

 

My issue is that I can connect to the LDAP with ldap_bind (return code in TRUE), but it doesn't care what I use for a password. It will let me in anonymously or with a known LDAP email address. However I can put in a bad password and it still lets me in.

 

One question I have: is it only possible to use a user password on the ldap_bind step? After I do the bind, I'd like to do a search, via ldap_search. But since the bind is ignoring the password, is there another way to authenticate a password on the ldap_search?

 

 

$ldaprdn='cn=vvv@vvv.com,ou=Service,o=theorg,dc=com'; 
$ldapbind = ldap_bind($ldap,$ldaprdn); 

 

This works even when I put in a bogus password:

$ldaprdn='cn=vvv@vvv.com,ou=Service,o=theorg,dc=com'; 
$ldapbind = ldap_bind($ldap,$ldaprdn, 'testpw'); 

 

It returns TRUE.

 

 

The end result is that if a user is trying to log in on a form that validates against the LDAP, their user id will be checked, but they could put in any password they want and it will let them in.

 

Any suggestions?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.