logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Catalyst::Authentication::Credential::NoPassword - Authenticate a user without a password.

Configuration

           # example
           <Plugin::Authentication>
               <nopassword>
                   <credential>
                       class = NoPassword
                   </credential>
                   <store>
                       class = DBIx::Class
                       user_model = DB::User
                       role_relation = roles
                       role_field = name
                   </store>
               </nopassword>
           </Plugin::Authentication>

Description

       This authentication credential checker takes authentication information (most often a username) and
       retrieves the user from the store. No validation of any credentials is done. This is intended for
       administrative backdoors, SAML logins and so on when you have identified the new user by other means.

Methods

authenticate($c,$realm,$authinfo)
       Try to log a user in.

perl v5.40.0                                       2024-10-28             Catalyst::Authe...ial::NoPassword(3pm)

Name

       Catalyst::Authentication::Credential::NoPassword - Authenticate a user without a password.

Synopsis

           use Catalyst qw/
             Authentication
             /;

           package MyApp::Controller::Auth;

           sub login_as_another_user : Local {
               my ($self, $c) = @_;

               if ($c->user_exists() and $c->user->username() eq 'root') {
                   $c->authenticate( {id => c->req->params->{user_id}}, 'nopassword' );
               }
           }

See Also