Using LDAP in PHP to get Active Directory info always returns Invalid credentials
Posted on 2008-10-06
Let me preface this question with, I am not a sys admin by any means. I am a LAMP developer attempting to use PHP's LDAP extension to authenticate users of a PHP application against my client's Active Directory accounts.
Windows 2003 running Apache 2.2 and PHP 5.2
Windows box running Active Directory
The sys admin send me a screenshot of the Active Directory tree. My account was located on:
ad host machine: box2
My account is in the Our Users -> Our Department -> Our Team folder.
$connection = ldap_connect('box2'); <------- works
ldap_bind($connection,'cn=billybob,ou=Our Users,ou=Our Department,ou=Our Team,dc=area1,dc=area2,dc=local','mypassword'); <------- throws 'Unable to bind to server: Invalid credentials'