Re: does PEAR auth expects the username & password encrypted in the database?



I found the answer to my problem:
By default, the *username* is in plain text and the *password* must be
stored in the database with md5 encryption.

Found this in the source code: pear/Auth/container.php line 104, within
function verifyPasssword.
It might be helpfull to someone else.

Cheers,
Oscar

Fun
odaldecoa@xxxxxxxxx wrote:
Hi all in php.general,

I would appreciate very much if any of you could help me to get this
simple auth example to work.

When running a pear auth example (below), Auth connects correctly to
the database, but the username and password I type in the login-form
are never recognized, so I cannot login.

I think it's a problem with the way I've stored my username and
password in the database.
I've tried plain text, MD5 encryption for the password, MD5 for both
user name and password (using phpmyadmin), but yet I cannot login.
Do the username & password in the database need to be encrypted?

Would you have any hints of what I am doing wrong?

Many thanks in advance for any help you can provide.
Best wishes,
Oscar
: )


This is the example script from
http://pear.php.net/manual/en/package.authentication.auth.intro.php:


<?php
require_once "Auth.php";

function loginFunction()
{
echo "<form method=\"post\" action=\"testauth.php\">";
echo "<input type=\"text\" name=\"username\">";
echo "<input type=\"password\" name=\"password\">";
echo "<input type=\"submit\">";
echo "</form>";
}

$dsn = "mysql://admin:xxxxxx@localhost/testoscar";
$a = new Auth("DB", $dsn, "loginFunction");

$a->start();

if ($a->checkAuth()) {
echo "welcome";
}
else {
echo "login error";
}
?>

.



Relevant Pages

  • PHP, Md5, and password retreival forms..
    ... I hired a guy to help me setup the database. ... the passwords are stored using Md5 encryption in ... I was able to get a password retrieval form working, ... but its sending the passwords encrypted. ...
    (comp.lang.php)
  • Re: PDO: Switch database user without reopening connection
    ... At the bare minimum there will be a login user who only has ... modifications to the database as well (editors get update permission, ... As database connections are expensive to ... a certain visitor in the Session, and use that value to start the right ...
    (comp.lang.php)
  • Re: PDO: Switch database user without reopening connection
    ... At the bare minimum there will be a login user who only has ... the postgres user they are logged in as to one that can make ... modifications to the database as well (editors get update permission, ... As database connections are expensive to ...
    (comp.lang.php)
  • RE: How to allow users to change their password?
    ... be set up to provide the Security dialog window for password changes. ... I'll have to login using their login ... > name/password first. ... See http://www.QBuilt.com for all your database needs. ...
    (microsoft.public.access.security)
  • Re: Please! Doesnt anyone know a better way to do this?
    ... account, they need to automatically be directed to the page to enter data ... session variable on the Account page. ... I assume here that you're checking a database when the user attempts to ... When a new user attempts to login or clicks to register, ...
    (microsoft.public.dotnet.framework.aspnet)