Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: comparing md5 hashed passwords

by cees (Curate)
on Feb 16, 2006 at 15:27 UTC ( [id://530669]=note: print w/replies, xml ) Need Help??


in reply to comparing md5 hashed passwords

You have your CREDENTIALS setup so that you require 3 pieces of information to authenticate (authen_username, authen_domain, authen_password). But then in the DBI Driver, you are using __CREDENTIAL_2__ as the password, even though it is number 3 in your list. If you remove the 'authen_domain' entry, it should start to work.

Also, since DBIx::UserDB has it's own method for testing authentication, it might be easier to use that method through a callback, instead of the DBI driver. That way if DBIx::UserDB ever changes the DB structure, your code will still work.

use Digest::MD5 qw(md5_hex); DistroPrsRls->authen->config( DRIVER => [ 'Generic', sub { my $username = shift; # credential 1 my $password = shift; # credential 2 if ($userdb->user_login($username, md5_hex($password)) { return $username; } return; } ], STORE => 'Session', POST_LOGIN_RUNMODE => 'login_welcome', POST_LOGIN_CALLBACK => \&update_login_date, CREDENTIALS => [ 'authen_username', 'authen_password' ], LOGIN_SESSION_TIMEOUT => { IDLE_FOR => '5m', EVERY => '1h' }, );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://530669]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-11-12 10:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    chatterbot is...






    Results (39 votes). Check out past polls.