Re: Re: PHP, LDAP, Authentication
| From: | Timo Boettcher | Date: | Sat, 08 Mar 2003 17:33:18 +0000 |
| Subject: | Re: Re: PHP, LDAP, Authentication | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142908@lists.php.net to get a copy of this message | ||
Hi Marcus,
Nachricht vom Dienstag, 8. April 2003, 14:49:02:
> 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
I hope you are NOT using register_globals with
$is_authenticated==true
but
$_SESSION["is_authenticated"]==true
Timo