From: Jeff Davis Date: Mon, 6 Jul 2020 18:32:57 +0000 (-0700) Subject: Basic test authenticator for AuthProxy X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=21262c84bce8c689c9ce33ffe847a7bdd798a322;p=working%2FEvergreen.git Basic test authenticator for AuthProxy Signed-off-by: Jeff Davis --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AuthProxy/Test.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AuthProxy/Test.pm new file mode 100644 index 0000000000..9fb62c36f5 --- /dev/null +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AuthProxy/Test.pm @@ -0,0 +1,30 @@ +package OpenILS::Application::AuthProxy::Test; +use strict; +use warnings; +use base 'OpenILS::Application::AuthProxy::AuthBase'; +use OpenILS::Event; + +sub authenticate { + my ( $self, $args ) = @_; + my $username = $args->{username}; + my $password = $args->{password}; + + if (!$username or !$password) { + return OpenILS::Event->new('LOGIN_FAILED'); + } + + my $logins = { + # no native Evergreen account + '99999393000' => 'nonexistentbarcode', + # valid account, AuthProxy password differs from EG password + '99999393004' => 'authproxypassword' + }; + + if (exists $logins->{$username} and $logins->{$username} eq $password) { + return OpenILS::Event->new('SUCCESS'); + } else { + return OpenILS::Event->new('LOGIN_FAILED'); + } +} + +1;