[Catalyst] Authentication - unix crypt

upb usr_bin_perl at yahoo.com
Tue Dec 12 14:02:44 GMT 2006


I've built an app using the Tutorial as a guide. I'm
authenticating with a user table using plain text
passwords (just as in the tutorial). Now I'd like to
use existing user data that has passwords stored using
unix Crypt (with the crypt function in Perl). 

After reading the docs, it looks like I can use

Catalyst::Plugin::Authentication::Credential::Password

but I'm unclear exactly what I need to do.

>From the docs, I see this goes somewhere...

$user->supported_features(qw/password crypted/);

and that there is an expected method -
crypted_password  - which returns the user's crypted
password as a string, with the salt as the first two
chars.

Our passwords are crypted using the example in the
Perl Cookbook (or Camel book)...

my $salt = join '',
('.','/',0..9,'A'..'Z','a'..'z')[rand 64,rand 64];
my $crypt_pwd = crypt($plain_pwd,$salt);
 
I've just started using Catalyst, and this is the
first thing that's tripped me up. 

Thank you.



 
____________________________________________________________________________________
Need a quick answer? Get one in minutes from people who know.
Ask your question on www.Answers.yahoo.com



More information about the Catalyst mailing list