[Catalyst] Authentication hashing

Gavin Henry ghenry at perl.me.uk
Mon Jan 2 13:04:15 CET 2006


<quote who="Kevin Old">
> Hello everyone,
>
> Happy New Year!  I have resently begun integrating
> Catalyst::Plugin::Authentication::Store::DBIC into an app I'm working
> on.  I've configured the authentication just like the POD example.
> Below is what I use to create a new user in the database via the
> Authentication::Store::DBIC module, but it does not encrypt the
> password.  I have the lines:
>
> password_type      => 'hashed',
> password_hash_type => 'SHA-1',
>
> in my __PACKAGE__->config->{authentication}->{dbic} hash (as stated
> before I use the example in the POD), but the password in the database
> is stored in cleartext.
>
> Here's what I use to insert a new user:
>
> sub createuser : Local {
>     my ( $self, $c ) = @_;
>
>     if (    my $username = $c->req->param("username")
>         and my $password = $c->req->param("password")
>         and my $other = $c->req->param("other") )
>     {
>         my %user = (
>             username => $username,
>             password => $password,
>             other => $other,
>         );
>
>         # Create the object
>         my $new_user = BIOAdmin::Model::BIOAdminDB::User->new(\%user);
>
>         # Insert the user
>         $new_user->insert_or_update;
>     }
> }
>
> How do I get the password type applied to $c->req->param("password")?
> I read all of the docs for the module and searched the archive and
> couldn't figure it out.

The only thing I can think of is make sure:

Catalyst::Plugin::Authentication::Store::DBIC::User

is installed, but if it wasn't you would probably get an error anyway.

Sorry, that's not much help :-(

>
> Any help is appreciated,
> Kevin
> --
> Kevin Old
> kevinold at gmail.com
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>


-- 
Walking the road to enlightenment... I found a penguin and a camel on the
way..... Fancy a yourname at perl.me.uk? Just ask!!!
http://perlmonks.org/?node_id=386673



More information about the Catalyst mailing list