brayann36 Posted November 19, 2013 Share Posted November 19, 2013 Hey fellas , I was clueless about LDAP AND AD when i was told to create a login page for my web-app and check authentication with AD server . After searching through , i came to know what this LDAP is all about .i need to get started with it , so i have a email feild and password . All worstations at my workplace have access to that server , as we use it to log on to the system . I need to use the same mechnism in mylogin page . please Help me , how to get started with it , what all things will be necessary .This article will be a great help to not only me but to all new PHP developers because somewhere down the line everyone is going to need this . P.S. I have the host name and port of the server where all login details are present i need some php class and tweaks in it to access it on hitting the login button .Thanks . Quote Link to comment https://forums.phpfreaks.com/topic/284044-php-authentication-using-ldap/ Share on other sites More sharing options...
boompa Posted November 19, 2013 Share Posted November 19, 2013 A Google search with your thread's title yields quite a few resources. everyone is going to need this Not everyone. A relatively small subset of PHP developers will need to authenticate via LDAP. Quote Link to comment https://forums.phpfreaks.com/topic/284044-php-authentication-using-ldap/#findComment-1459094 Share on other sites More sharing options...
Barand Posted December 1, 2013 Share Posted December 1, 2013 I found the ADLDAP class invaluable when dealing with AD http://adldap.sourceforge.net/ Quote Link to comment https://forums.phpfreaks.com/topic/284044-php-authentication-using-ldap/#findComment-1460839 Share on other sites More sharing options...
Irate Posted December 1, 2013 Share Posted December 1, 2013 My school network uses LDAP on a Squid server if I'm not mistaken... I can ask for some help, I guess? Quote Link to comment https://forums.phpfreaks.com/topic/284044-php-authentication-using-ldap/#findComment-1460885 Share on other sites More sharing options...
Petermichael703 Posted December 5, 2013 Share Posted December 5, 2013 Of course Mr. Irate can ask any question any time anywhere but on related forum Quote Link to comment https://forums.phpfreaks.com/topic/284044-php-authentication-using-ldap/#findComment-1461365 Share on other sites More sharing options...
KevinM1 Posted December 5, 2013 Share Posted December 5, 2013 Please don't play moderator. Quote Link to comment https://forums.phpfreaks.com/topic/284044-php-authentication-using-ldap/#findComment-1461378 Share on other sites More sharing options...
Irate Posted December 5, 2013 Share Posted December 5, 2013 I guess I was being misunderstood... I could ask my school's sysadmin for help, that's what I meant to say. Quote Link to comment https://forums.phpfreaks.com/topic/284044-php-authentication-using-ldap/#findComment-1461416 Share on other sites More sharing options...
dakota367 Posted January 6, 2014 Share Posted January 6, 2014 Basic steps will be to open a connection to the LDAP server, this is done with ldap_connect(), this does not require authentication. Next you will bind to the LDAP directory, this step is when you will check the information your user provided. Use the ldap_bind() function, this will return true if the credentials provided by your user are valid and false if they are not. Please note that on the username at lease when I worked with this (Windows Active Directory) did require the name of the domain in front of the username (i.e domainName\userName). If you want to go further and make sure the user is a member of a group that is allowed to access the application you can search for the user object using ldap_search() and ldap_get_entries() and check the memberof attribute for the group. If all of the tests pass do what you would do during any other authentication method, set session and or cookie variables maybe update a database or log. Make sure the if the LDAP bind was successful you call the ldap_unbind() function after you have collected your user information from the directory. Quote Link to comment https://forums.phpfreaks.com/topic/284044-php-authentication-using-ldap/#findComment-1464035 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.