Lines 28-36
Koha::Auth::TwoFactorAuth- Koha class deal with Two factor authentication
Link Here
|
28 |
|
28 |
|
29 |
use Koha::Auth::TwoFactorAuth; |
29 |
use Koha::Auth::TwoFactorAuth; |
30 |
|
30 |
|
31 |
my $secret = Koha::AuthUtils::generate_salt( 'weak', 16 ); |
31 |
my $auth = Koha::Auth::TwoFactorAuth->new({ patron => $patron }); |
32 |
my $auth = Koha::Auth::TwoFactorAuth->new( |
|
|
33 |
{ patron => $patron, secret => $secret } ); |
34 |
my $secret32 = $auth->generate_secret32; |
32 |
my $secret32 = $auth->generate_secret32; |
35 |
my $ok = $auth->verify($pin_code, 1, $secret32); |
33 |
my $ok = $auth->verify($pin_code, 1, $secret32); |
36 |
|
34 |
|
Lines 40-46
It's based on Auth::GoogleAuth
Link Here
|
40 |
|
38 |
|
41 |
=head3 new |
39 |
=head3 new |
42 |
|
40 |
|
43 |
$obj = Koha::Auth::TwoFactorAuth->new({ patron => $p, secret => $s }); |
41 |
$obj = Koha::Auth::TwoFactorAuth->new({ patron => $p, [secret => $secret], [secret32 => $secret32] }); |
44 |
|
42 |
|
45 |
=cut |
43 |
=cut |
46 |
|
44 |
|