[Catalyst] Authentication hashing

Michele Beltrame mb at italpro.net
Tue Jan 3 12:56:39 CET 2006


Hi!

> password_type      => 'hashed',
> password_hash_type => 'SHA-1',
 >
 > [...]
>
> How do I get the password type applied to $c->req->param("password")? 

I believe the settings of this plugin are only using when 
authenticating, that is when comparing the given password with the 
stored one.

To store and encrypted password when adding it to the database you could 
use the FormValidator plugin, specifying field_filters as following:

     field_filters => {
         passwd => sub {
             my $o = shift;
             return Digest::SHA::sha1_hex($o);
         }
     }

This automatically hashes the password value when you validate your form 
input. The are other ways of course, for example I think you could have 
DBIx::Class do this automatically for your password field.

Hope this helps.

	Michele.

-- 
Michele Beltrame
http://www.massainforme.it/
ICQ# 76660101
Informativa privacy: http://www.italpro.net/em.html



More information about the Catalyst mailing list