Koha-clms/Koha/REST
Tomas Cohen Arazi 5d191f21e5
Bug 33675: Add CSRF protection to OAuth/OIDC authentication
This patch makes the OAuth/OIDC client pass a `state` parameter with a
CSRF protection token, to be validated back when the flow returns to
Koha.

Ideally, the Mojolicious::Plugin::OAuth2 library should deal with this
implicitly, probably making use of JWT. But as of now, this is the best
way to implement it.

To test:
1. Have a working SSO solution (ktd --sso)
2. Click to login using SSO
=> SUCCESS: Notice a 'state' parameter on the URL, looks like a random
thing
3. When you login, no error is reported

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-19 09:20:54 -03:00
..
Plugin Bug 32713: Throw exception on unexpected x-koha-embed header 2023-03-16 16:12:31 -03:00
V1 Bug 33675: Add CSRF protection to OAuth/OIDC authentication 2023-05-19 09:20:54 -03:00
V1.pm Bug 31378: (follow-up) catch startup error when missing Oauth provider table 2022-11-08 14:40:10 -03:00