How to configure ldap login with php

Posted by Drew G on Stack Overflow See other posts from Stack Overflow or by Drew G
Published on 2012-10-19T04:57:21Z Indexed on 2012/10/19 5:00 UTC
Read the original article Hit count: 170

Filed under:
|

I'm attempting to implement a login that works with ldap, My extension=php_ldap.dll is uncommented in both of my php config files, ldap shows up in my phpinfo() I have access to AD and I've been using dsquery to snoop around. So I believe I'm very close to achieving my goal

function authenticate($user, $password) {
$ldap_host = "na.ad.mycompanyname.com";
$ldap_dn = "CN=USA-USERS,DC=ad,DC=mycompanyname,DC=com";
$ldap_user_group = "Domain Users";
$ldap_manager_group = "Domain Admins";
$ldap_usr_dom = "@na.ad.mycompany.com";

So for now when I enter my login credentials, it fails and I get the appropriate error, my question is, what information do I need to enter and which dsquery commands should I use? Without being spoonfed, could someone point me in the right direction? I've done some extensive research, but nothing I could find really assists with figuring out which CN's and OU's to use. Yes I realize I need to be using the correct CN's and OU's that correspond to my location, but I've been trying the guess and check method to no avail, so I figured I would ask. Any assistance is appreciated. THANKS!!!

© Stack Overflow or respective owner

Related posts about php

Related posts about active-directory