Koha-clms/Koha/REST/Plugin
Tomas Cohen Arazi 3eb91ce952
Bug 37711: Add support for staff interface auto-register on IdP
Before this patches, only OPAC auto-registration at login using
OAuth2/OIDC IdPs was allowed.

This patch makes the staff interface to be able to auto-register new
users.

On doing it, I had to track down the possible values for the `interface`
parameter in the case of the staff interface.
Koha::Template::Plugin::AuthClient uses 'staff' internally so I sticked
with it. The whole area needs more param validation and exceptions to
avoid mistakes for not knowing the valid values.

I added some safeguards on the Koha::REST::Plugin::Auth::IdP helpers.
They get tested on the added tests.

To test:
1. Apply this patch
2. Run:
   $ prove t/db_dependent/Koha/REST/Plugin/Auth/IdP.t
=> SUCCESS: Tests pass!
3. Have a valid OAuth...
4. Enable Staff auto-register
5. Login with an external IdP on the staff interface
=> SUCCESS: It gets registered!
Note: it will probably lack permissions to access the staff interface,
but you can check on the DB it got registered.
6. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-05 07:12:32 -07:00
..
Auth Bug 37711: Add support for staff interface auto-register on IdP 2025-11-05 07:12:32 -07:00
Exceptions.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Objects.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Pagination.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
PluginRoutes.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Query.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
Responses.pm Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00