Bug 32138

Summary: OIDC client uses backwards default mapping
Product: Koha Reporter: David Cook <dcook>
Component: AuthenticationAssignee: David Cook <dcook>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: dpavlin, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Bug Depends on: 31378    
Bug Blocks:    
Attachments: Bug 32138: Fix OIDC default mapping
Bug 32138: Fix OIDC default mapping

Description David Cook 2022-11-08 23:56:53 UTC
The OAuth2 client has a good default mapping, but the OIDC client has the first name and last name mappings backwards. Must be a mistake from an earlier iteration.
Comment 1 David Cook 2022-11-09 00:45:45 UTC
Created attachment 143451 [details] [review]
Bug 32138: Fix OIDC default mapping

This patch fixes the OIDC default mapping to have the Koha fields on
the left (ie key) and the OIDC standard claim fields on the right (ie value).

1. Apply the patch
2. Go to http://localhost:8081/cgi-bin/koha/admin/identity_providers.pl?op=add_form
3. Choose "OIDC" for "Protocol"
4. Click "Add default OIDC mapping"
5. Note the following is displayed:
{
  "email": "email",
  "firstname": "given_name",
  "surname": "family_name"
}
Comment 2 Tomás Cohen Arazi 2022-11-09 16:42:30 UTC
Created attachment 143528 [details] [review]
Bug 32138: Fix OIDC default mapping

This patch fixes the OIDC default mapping to have the Koha fields on
the left (ie key) and the OIDC standard claim fields on the right (ie value).

1. Apply the patch
2. Go to http://localhost:8081/cgi-bin/koha/admin/identity_providers.pl?op=add_form
3. Choose "OIDC" for "Protocol"
4. Click "Add default OIDC mapping"
5. Note the following is displayed:
{
  "email": "email",
  "firstname": "given_name",
  "surname": "family_name"
}

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Tomás Cohen Arazi 2022-11-09 17:40:24 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!