Bugzilla – Attachment 131951 Details for
Bug 28786
Two-factor authentication for staff client - TOTP
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28786: Correctly inherit from Auth::GoogleAuth
Bug-28786-Correctly-inherit-from-AuthGoogleAuth.patch (text/plain), 2.67 KB, created by
Jonathan Druart
on 2022-03-21 10:14:52 UTC
(
hide
)
Description:
Bug 28786: Correctly inherit from Auth::GoogleAuth
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-03-21 10:14:52 UTC
Size:
2.67 KB
patch
obsolete
>From 7d7bdd0a4fcd98fbce0524b2a47e3efa13665b95 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 13 Sep 2021 23:13:44 +0200 >Subject: [PATCH] Bug 28786: Correctly inherit from Auth::GoogleAuth > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Auth.pm | 2 +- > Koha/Auth/TwoFactorAuth.pm | 6 +++--- > members/two_factor_auth.pl | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index fadee2ead71..4546e6ab1d5 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -908,7 +908,7 @@ sub checkauth { > && ( my $otp_token = $query->param('otp_token') ) ) > { > my $patron = Koha::Patrons->find( { userid => $userid } ); >- my $auth = Koha::Auth::TwoFactorAuth::get_auth( { patron => $patron } ); >+ my $auth = Koha::Auth::TwoFactorAuth->new( { patron => $patron } ); > my $verified = $auth->verify($otp_token); > $auth->clear; > if ( $verified ) { >diff --git a/Koha/Auth/TwoFactorAuth.pm b/Koha/Auth/TwoFactorAuth.pm >index c08736f506b..f66379200d9 100644 >--- a/Koha/Auth/TwoFactorAuth.pm >+++ b/Koha/Auth/TwoFactorAuth.pm >@@ -38,8 +38,8 @@ It's based on Auth::GoogleAuth > > =cut > >-sub get_auth { >- my ($params) = @_; >+sub new { >+ my ($class, $params) = @_; > my $patron = $params->{patron}; > my $secret = $params->{secret}; > my $secret32 = $params->{secret32}; >@@ -52,7 +52,7 @@ sub get_auth { > my $key_id = sprintf "%s_%s", > $issuer, ( $patron->email || $patron->userid ); > >- return Auth::GoogleAuth->new( >+ return $class->SUPER::new( > { > ( $secret ? ( secret => $secret ) : () ), > ( $secret32 ? ( secret32 => $secret32 ) : () ), >diff --git a/members/two_factor_auth.pl b/members/two_factor_auth.pl >index ce5143ea7da..2a5a996c566 100644 >--- a/members/two_factor_auth.pl >+++ b/members/two_factor_auth.pl >@@ -48,7 +48,7 @@ my $op = $cgi->param('op') // ''; > if ( $op eq 'register-2FA' ) { > my $pin_code = $cgi->param('pin_code'); > my $secret32 = $cgi->param('secret32'); >- my $auth = Koha::Auth::TwoFactorAuth::get_auth( >+ my $auth = Koha::Auth::TwoFactorAuth->new( > { patron => $logged_in_user, secret32 => $secret32 } ); > > my $verified = $auth->verify( >@@ -75,7 +75,7 @@ if ( $op eq 'register-2FA' ) { > if ( $op eq 'enable-2FA' ) { > > my $secret = Koha::AuthUtils::generate_salt( 'weak', 16 ); >- my $auth = Koha::Auth::TwoFactorAuth::get_auth( >+ my $auth = Koha::Auth::TwoFactorAuth->new( > { patron => $logged_in_user, secret => $secret } ); > > my $secret32 = $auth->generate_secret32; >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28786
:
123375
|
123376
|
123377
|
123378
|
123379
|
123380
|
123381
|
123397
|
123398
|
123399
|
123400
|
123401
|
123402
|
123403
|
124569
|
124770
|
124771
|
124844
|
124845
|
124846
|
124847
|
128841
|
128842
|
129383
|
129384
|
129474
|
129521
|
129557
|
129558
|
129559
|
129560
|
129561
|
129562
|
129563
|
129564
|
129565
|
129566
|
129567
|
129568
|
129569
|
129654
|
129655
|
129656
|
129657
|
129658
|
129659
|
129660
|
129661
|
129662
|
129665
|
131940
|
131941
|
131942
|
131943
|
131944
|
131945
|
131946
|
131947
|
131948
|
131949
|
131950
|
131951
|
131952
|
131953
|
131954
|
131955
|
131956
|
131957
|
131958
|
132142
|
132143
|
132144
|
132145
|
132146
|
132147
|
132148
|
132149
|
132150
|
132153
|
132154
|
132155
|
132156
|
132157
|
133222
|
133516
|
133522
|
133531
|
133533
|
133541
|
133548
|
133643
|
133686