Koha/koha-tmpl/intranet-tmpl/prog/en/includes/auth-two-factor.inc
David Cook a51d570a6e Bug 34028: Fix manual entry for two factor authentication
This patch changes the "Account" and "Key" display so that
you can manually enter two factor authentication details into
an authenticator app.

The details are the same as those provided by scanning the QR code.

Test plan:
0. Apply patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=TwoFactorAuthentication
2. Change setting to "Enable"
3. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
4. Click "More" on record toolbar and choose "Manage two-factor authentication"
5. Click "Enable two-factor authentication"
6. Scan the QR code into an authenticator app and note it creates an entry called
"Centerville: Centerville_koha"
7. Manually enter an entry into an authenticator app (like Google Authenticator)
7a. Add the "Account" as shown on the Koha screen
7b. Add the "Key" as shown on the Koha screen
8. Note that the entries added by QR code and manual entry have the same
label and both were accepted by the authenticator app

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7c05333914)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-06-26 14:56:48 +02:00

32 lines
1.5 KiB
HTML

[% BLOCK registration_form %]
<div id="registration-form" style="display: none;">
<div class="dialog message">
<p>We recommend cloud-based mobile authenticator apps such as Authy, Duo Mobile, and LastPass. They can restore access if you lose your hardware device.</p>
<p>Can't scan the code?</p>
<p>To add the entry manually, provide the following details to the application on your phone.</p>
<p>Account: "<span id="issuer">[% issuer | html %]</span>: <span id="key_id">[% key_id | html %]</span>"</p>
<p>Key: "<span id="key_secret">[% secret32 | html %]</span>"</p>
<p>Time based: Yes</p>
</div>
<div id="errors" class="dialog error" style="display: none;"></div>
<fieldset class="rows">
<input type="hidden" id="secret32" name="secret32" value="[% secret32 | html %]" />
<ol>
<li>
<label for="qr_code">QR code: </label>
<img id="qr_code" src="" />
</li>
<li>
<label for="pin_code">PIN code: </label>
<input type="text" id="pin_code" name="pin_code" value="" />
</li>
</ol>
</fieldset>
<fieldset class="action">
<input id="register-2FA" type="submit" value="Register with two-factor app" />
<a class="cancel" href="/cgi-bin/koha/members/two_factor_auth.pl">Cancel</a>
</fieldset>
</div>
[% END %]