Re: Auth_HTTP, it's not authenticating...
| From: | Stan Lemon | Date: | Tue, 29 Jul 2003 12:37:55 +0000 |
| Subject: | Re: Auth_HTTP, it's not authenticating... | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-6895@lists.php.net to get a copy of this message | ||
Yup, encrypted it using md5() and dumped it in.
At some point last night I did manage to get addUser() to add a user to the DB, so I now know that I am connected and have all of my DB information entered correctly.
I wonder, is the rest of my little script written correctly to allow for a correct username/password combo to stop prompting me? Like I said in my first e-mail, I am very unfamiliar with this package.
Thanks for the help,
- Stan
Alexander Czernay wrote:
Did you encrypt your passwords with MD5 in the database? Auth actually checks for the encrypted password, rather than the plaintext one. -- Alexander ________________________________ Alexander Czernay IT-Consulting & Media Development fon +49-40-41096742 fax +49-40-41096743 icq 4773650 alexander@czernay.com www.czernay.com _________________________________ Stan Lemon wrote:I found those and unfortunatley still had the same problems. I also upgraded Auth tonight. (By the way the dns/dsn error is in the PEAR documentation) I'm clueless. Is there any way to get good errors from what's going on with the DB in this? - Stan Ian Leckie wrote:On Monday, July 28, 2003, at 02:03 PM, Stan Lemon wrote:I am trying to use Auth_HTTP to authenticate a user before accessing content. I have a table in the db called scl_users with uid (varchar(32)) and password (varchar(32)). I use the following code: <?php //print md5("password"); //require_once "DB.php"; require_once "Auth_HTTP/Auth_HTTP.php"; $dsn = "mysql://....";You have 2 errors in this code. 1: in the intro you claim that the password field is called 'password', but then you set $options['passwordcol'] to 'pword'. 2. you are setting $options['dns'] rather than $options['dsn']. If those errors are in your actual code, they would account for your problems.$options = array('table' => 'scl_users', 'usernamecol' => 'uid', 'passwordcol' => 'pword', // 'cryptType' => 'md5', 'dns' => $dsn,);