[Catalyst] password and Catalyst::Plugin::Authentication::CDBI

Jason Kohles email at jasonkohles.com
Fri Sep 30 19:11:36 CEST 2005


On Sep 29, 2005, at 11:38 AM, Sai Tong wrote:


>
> How does one generate password to use with authentication by
>
> Catalyst::Plugin::Authentication::CDBI
>
> ?
>
> Is the password stored as encrypted text in the corresponding  
> database table (Model)?
>
>

It depends on the settings in your config, if you don't specify a  
password_hash entry, then the password is stored as clear text, if  
you do specify password_hash, then you need to hash the password  
appropriately.

The way the plugin looks at it is:

If password_hash contains 'sha', then use sha1_hex:
   use Digest::SHA qw(sha1_hex);
   print sha1_hex($password)."\n";

If password_hash contains 'md5', then use md5_hex:
   use Digest::MD5 qw(md5_hex);
   print md5_hex($password)."\n";

Otherwise the password field is assumed to contain the cleartext  
password.





More information about the Catalyst mailing list