Re: PHP, LDAP, Authentication

From: Date: Tue, 08 Apr 2003 13:49:02 +0000
Subject: Re: PHP, LDAP, Authentication
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-142861@lists.php.net to get a copy of this message
Here is how I authenticate using PHP and LDAP. So far it has worked pretty well.... Have a form where the user inputs their username/password. Start a session and set an is_authenticated session variable to 'false'. Then Bind to the LDAP server anonymously and do a search for the input username. If the username is not found then this is not a valid user and you return a bad username error. If the username is found then this is a valid user and you can validate the password. Next bind to the LDAP server using the valid username and the input password. If an error is returned then return a bad password error. If the password is good then set the is_authenticated session variable to 'true' and get any other info you need from the LDAP server and store this data in session variables. Then at the beginning of each page that needs authentication, check the is_authenticated session variable for 'true'. HTH > > > -----Original Message----- > From: Simon [mailto:velikanka@hotmail.com] > Sent: Tuesday, April 08, 2003 8:33 AM > To: php-general@lists.php.net > Subject: [PHP] Re: PHP, LDAP, Authentication > > > Simon wrote: >> Hi, >> >> I need to authorise users with ldap and php. Does anybody have any >> example script how to do it. Sessions will be great. >> >> TNX >> > anybody? Is it possible to authenticate userst through php and ldap by > using sessions? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#142861) next »