From: Matt S Trout Date: Tue, 17 Jul 2007 16:59:13 +0000 (+0000) Subject: Adding 'None' option to password_type - allowing 'retrieve only' authentication X-Git-Tag: v0.10009_01~66 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=171855975440fcfe8586c9695906920ebbecd5f1;p=catagits%2FCatalyst-Plugin-Authentication.git Adding 'None' option to password_type - allowing 'retrieve only' authentication r42000@cain (orig r6285): jayk | 2007-04-14 03:10:47 +0000 --- diff --git a/lib/Catalyst/Plugin/Authentication/Credential/Password.pm b/lib/Catalyst/Plugin/Authentication/Credential/Password.pm index 081dca7..0baa52e 100644 --- a/lib/Catalyst/Plugin/Authentication/Credential/Password.pm +++ b/lib/Catalyst/Plugin/Authentication/Credential/Password.pm @@ -60,9 +60,11 @@ sub check_password { my $password = $authinfo->{$self->_config->{'password_field'}}; my $storedpassword = $user->get($self->_config->{'password_field'}); - if ($self->_config->{password_type} eq 'clear') { + if ($self->_config->{'password_type'} eq 'none') { + return 1; + } elsif ($self->_config->{'password_type'} eq 'clear') { return $password eq $storedpassword; - } elsif ($self->_config->{'password_type'} eq 'crypted') { + } elsif ($self->_config->{'password_type'} eq 'crypted') { return $storedpassword eq crypt( $password, $storedpassword ); } elsif ($self->_config->{'password_type'} eq 'salted_hash') { require Crypt::SaltedHash; @@ -283,6 +285,12 @@ from the user object. The supported options are: =over 8 +=item none + +No password check is done. An attempt is made to retrieve the user based on +the information provided in the $c->authenticate() call. If a user is found, +authentication is considered to be successful. + =item clear The password in user is in clear text and will be compared directly.