Bug 29873: Create QR code
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 13 Jan 2022 14:27:36 +0000 (14:27 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 2 May 2022 21:22:58 +0000 (11:22 -1000)
commit8bd314fe0b76343d9c96e9c6cd725bc583d488d2
tree6fdb7c1a6c28d4f4f068772ab7457babbe65caa5
parent37acf46b7e82e9e30d2926d7e7f6953c804a88ff
Bug 29873: Create QR code

Instead of using deprecated Google Charts API, and exposing our
secret in a GET parameter, we generate QR data ourselves.

Test plan:
[1] Enable two factor authentication in the prefs.
[2] Login in staff. Go to account. Select Manage 2FA.
[3] Verify that QR code is displayed.
[4] Register the QR in your authenticator app and test 2FA
    by logging in again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with Google Authenticator and FreeOTP.

Bug 29873: (follow-up) Rename qr_dataurl

As requested by a QA team member.
We're moving to qr_code as method name. This is the same name as
the method in the underlying base class.
Apart from one sed statement, changing to self->SUPER on one line.

Test plan:
Can you still register, logout and login?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 29873: (follow-up) Switch to GD

We do not need a new module, we could use GD instead.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Auth/TwoFactorAuth.pm
koha-tmpl/intranet-tmpl/prog/en/modules/members/two_factor_auth.tt
members/two_factor_auth.pl