Go to file
Jonathan Druart b257f25b1b Bug 29543: [19.11] Enforce authentication for self-checkout
The self-checkout feature is assuming a patron is logged in if patronid
is passed. It also assumes that "We're in a controlled environment; we
trust the user", which is terribly wrong!

This patch is suggesting to generate a JSON Web Token (JWT) to store in
a cookie and only allow action (renew, check in/out) is the token is
valid. The token is only generated once the user has been authenticated
And is removed when the user finish the session/logout.

Test plan:
You must know exactly how the self-checkout feature works to test this patch.
The 4 following sysprefs must be tested:
 SelfCheckoutByLogin, AutoSelfCheckAllowed, AutoSelfCheckID, AutoSelfCheckPass
Confirm that you can renew, checkin for the items you own, and checkout new items.
Confirm that you are not allowed to access other account's info.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: Remove borrower variable

It's not needed, we have $patron

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: Remove inputfocus variable

It's not used in template

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: Add JWT token handling

Mojo::JWT is installed already, it's not a new dependency.
We need a way to send the patron a token when it's correctly logged in,
and not assumed it's logged in only if patronid is passed

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: Prevent user to checkin or renew items they don't own

Checkin or renew must be restricted to the items they own.

Test plan:
Create an item with barcode bc_1
Check it in to user A
Login to SCO with user B
Get the token using the browser dev tool, from the cookie
Hit (replace $JWT)
    /cgi-bin/koha/sco/sco-main.pl?jwt=$JWT&op=renew&barcode=bc_1
    /cgi-bin/koha/sco/sco-main.pl?jwt=$JWT&op=returnbook&barcode=bc_1

You should see an error message

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: (follow-up) Add a warning to SelfCheckoutByLogin

This updates the language to warn users of risk if using cardnumber for login and auto-self-check is enabled

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Bug 29543: Add Mojo::JWT dependency

Bug 29543: Set autocomplete off for SCO login fields

Cardnumber already had it set, adding for username and password

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2022-01-21 04:39:38 +00:00
C4 Bug 29543: [19.11] Enforce authentication for self-checkout 2022-01-21 04:39:38 +00:00
Koha Bug 29543: [19.11] Enforce authentication for self-checkout 2022-01-21 04:39:38 +00:00
OpenILS
…
acqui Bug 26997: Remove 0000-00-00 from aqorders.datecancellationprinted 2021-03-18 21:02:44 +01:00
admin Bug 27416: Make "Modify tag" and "Add tag" translatable 2021-02-02 00:37:15 +01:00
api Bug 23653: [19.11] use local copy of swagger v2 schema 2021-07-08 01:33:52 +00:00
authorities Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
basket Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
catalogue Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
cataloguing Bug 26605: Correctly URI-encode query string in call number browse plugin 2020-11-17 18:15:44 +13:00
circ Bug 27676: Correct finesMode ne off condition 2021-02-21 16:18:24 +01:00
clubs Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
course_reserves Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
debian Bug 28364: Make log4perl.conf belong to the instance user 2021-06-16 07:37:00 +00:00
docs Bug 28904: Fix typo and display 2021-12-01 13:47:20 +00:00
errors Bug 23329: Move error page to its own subroutine 2019-11-27 11:30:19 +00:00
etc Revert "Bug 27299: Remove tokenization for phrase register/index with ICU" 2021-02-04 18:35:03 +01:00
ill
…
installer Increment version for 19.11.24 release 2022-01-04 04:32:38 +00:00
koha-tmpl Bug 29543: [19.11] Enforce authentication for self-checkout 2022-01-21 04:39:38 +00:00
labels Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
members Bug 29524: (bug 28935 follow-up) Restore modification of some patron's attributes 2021-12-01 13:31:10 +00:00
misc Update release notes for 19.11.24 release 2022-01-04 05:44:14 +00:00
offline_circ Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
opac Bug 29543: [19.11] Enforce authentication for self-checkout 2022-01-21 04:39:38 +00:00
patron_lists Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
patroncards Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
plugins Bug 25549: Add error reporting to plugins-home 2020-11-17 17:12:45 +13:00
reports Bug 28524: Escape 'rank' in cat_issues_top.pl 2021-07-22 07:47:35 +00:00
reserve Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
reviews Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
rotating_collections Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
serials Bug 26604: "Generate next" button gives error on serials-collection.pl 2020-11-17 16:45:07 +13:00
services
…
skel
…
suggestion Bug 22868: Move suggestions_manage subperm out of acquisition perm 2020-02-10 23:08:59 +00:00
svc Bug 26457: [19.11.x] Throw exception if update of issues table fails 2021-03-24 00:39:44 +01:00
t Bug 29543: [19.11] Enforce authentication for self-checkout 2022-01-21 04:39:38 +00:00
tags Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
tmp/modified_authorities
…
tools Bug 26298: Don't set too_many_items_to_process if equal to limit 2021-02-11 02:48:46 +01:00
virtualshelves Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
xt
…
.editorconfig
…
.eslintrc.json
…
.gitignore
…
.htaccess
…
.mailmap Bug 28386: Disambiguate Tomas and Blou 2021-06-30 05:23:21 +00:00
.scss-lint.yml
…
INSTALL
…
Koha.pm Increment version for 19.11.24 release 2022-01-04 04:32:38 +00:00
LICENSE
…
MANIFEST.SKIP
…
Makefile.PL Bug 25792: Rename 'ttf-dejavu' package to 'fonts-dejavu' for Debian 11 2020-09-09 22:18:40 +12:00
README
…
README.md Bug 27092: Remove note about "synced repo" from README.md 2020-12-16 22:36:52 +01:00
README.robots
…
about.pl Bug 28386: Sort authors by lastname || firstname 2021-06-30 05:24:20 +00:00
changelanguage.pl
…
fix-perl-path.PL
…
gulpfile.js Bug 26228: Update gulpfile to work with Node.js v12 2020-09-09 16:04:42 +12:00
help.pl
…
koha_perl_deps.pl
…
kohaversion.pl
…
mainpage.pl Bug 24663: [19.11.x] Remove authnotrequired if set to 0 2020-08-25 15:45:46 +12:00
package.json Bug 26228: Update gulpfile to work with Node.js v12 2020-09-09 16:04:42 +12:00
rewrite-config.PL Bug 25792: Rename 'ttf-dejavu' package to 'fonts-dejavu' for Debian 11 2020-09-09 22:18:40 +12:00
yarn.lock Bug 26228: Update gulpfile to work with Node.js v12 2020-09-09 16:04:42 +12:00

README.md

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo