ldap support
Moderator: General Moderators
ldap support
I am looking for support of ldap in php. I would like to authenticate and identify users against a ldap directory. If this is simple, just point me to the right documentation.
Most improtantly, PHP must have been compiled with LDAP support..
There is a fairly good tutorial at devshed here, and make sure you go on to part 2 of it as well..
Then there is ofcourse the manual...
There is a fairly good tutorial at devshed here, and make sure you go on to part 2 of it as well..
Then there is ofcourse the manual...
I just recently did what you are trying to do. I seond the devshed article(s) if you're new to LDAP or PHP. This article would've saved me some serious time -- instead I had to learn it all from scratch.
Anyhow, I'm using LDAP as authentication. Basically, a user supplies a userid/password via a login form. This information is used to attempt to bind to the LDAP directory. If the bind operation was successful (meaning the userid/password are valid), I set a session variable called LOGGED_IN to 1. At the beginning of all pages you can check this session variable for the login status and then proceed accordingly. I sort of modeled my approach after the login tutorial I found http://www.free2code.net/tutorials/prog ... plogin.php. It uses PHP/MySQL, but the logic is similar.
Let me know if you have any other questions. I'd be happy to share my code.
Anyhow, I'm using LDAP as authentication. Basically, a user supplies a userid/password via a login form. This information is used to attempt to bind to the LDAP directory. If the bind operation was successful (meaning the userid/password are valid), I set a session variable called LOGGED_IN to 1. At the beginning of all pages you can check this session variable for the login status and then proceed accordingly. I sort of modeled my approach after the login tutorial I found http://www.free2code.net/tutorials/prog ... plogin.php. It uses PHP/MySQL, but the logic is similar.
Let me know if you have any other questions. I'd be happy to share my code.