Koha-clms/Koha/REST/V1
David Cook 5cef65a87f Bug 30843: Add mfa_range configuration option for TOTP
This change adds a mfa_range configuration option for TOTP
to koha-conf.xml, and overrides the "verify" method from
Auth::GoogleAuth in order to provide a new default for "range"

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=TwoFactorAuthentication
3. Change the syspref to "Enable"
4. Go to
http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51
5. Click "More" and "Manage two-factor authentication"
6. Register using an app
7. In an Incognito window, go to
http://localhost:8081/cgi-bin/koha/mainpage.pl
8. Sign in with the "koha" user
9. Note down a code from your Authenticator app
10. Wait until after 60 seconds and try it
11. Note it says "Invalid two-factor code"
12. Try a new code from the app
13. Note that it works

14. Add <mfa_range>10</mfa_range> to /etc/koha/sites/kohadev/koha-conf.xml
15. Clear memcached and koha-plack --restart kohadev
16. Sign in with the "koha" user
17. Note down a code from your Authenticator app
18. Wait 4 minutes and then try it
19. Note that it works

20. Disable your two-factor authentication and click to re-enable it
21. Use a code older than 60 seconds when registering for the two
factor authentication
22. Note that the code works

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6a0955946e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-10-05 08:36:20 -10:00
..
Acquisitions Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Auth Bug 34313: Add patron information in pass validation response 2023-08-29 21:09:30 -10:00
Biblios Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
CashRegisters Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Clubs Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Config/SMTP Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
ERM Bug 34339: (QA follow-up) Replace new by search in Licenses 2023-09-08 09:40:16 -10:00
OAuth Bug 33675: Add CSRF protection to OAuth/OIDC authentication 2023-05-19 09:20:54 -03:00
Patrons Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
AdvancedEditorMacro.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
ArticleRequests.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Auth.pm Bug 33708: Allow anonymous access to OAuth endpoints 2023-05-18 11:35:16 -03:00
AuthorisedValueCategories.pm Bug 32997: Add REST API endpoint to list authorised values for multiple given categories 2023-03-02 12:00:15 -03:00
AuthorisedValues.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Authorities.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
BackgroundJobs.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Biblios.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Checkouts.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
CirculationRules.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Cities.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
ERM.pm Bug 32030: ERM - Users 2022-11-08 09:43:36 -03:00
Holds.pm Bug 34024: (QA follow-up) Allow pickup location changing for in transit holds 2023-08-21 20:24:39 -10:00
Illbackends.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Illrequests.pm Bug 22440: Add Koha::Illrequests->filter_by_visible 2023-05-05 09:13:40 -03:00
ImportBatchProfiles.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
ImportRecordMatches.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Items.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Libraries.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
OAuth.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Patrons.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Quotes.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
ReturnClaims.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
SearchFilter.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Stage.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
Static.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Suggestions.pm Bug 32942: (QA follow-up) Moving Suggestion->STATUS check to Suggestion::store 2023-09-20 20:01:17 -10:00
Tickets.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
TransferLimits.pm Bug 33556: Avoid relying on $c->validation 2023-08-07 20:05:46 -10:00
TwoFactorAuth.pm Bug 30843: Add mfa_range configuration option for TOTP 2023-10-05 08:36:20 -10:00