Bug 35617

Summary: Make phone number as match point in in Identity providers
Product: Koha Reporter: Slava Shishkin <slavashishkin>
Component: AuthenticationAssignee: Slava Shishkin <slavashishkin>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dpavlin, olivier.hubert, 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:
Circulation function:
Bug Depends on: 31378    
Bug Blocks:    
Attachments: Bug 35617: Extending the matchpoint in "identity_providers" by phone number

Description Slava Shishkin 2023-12-20 14:34:56 UTC
Currently, the system supports match points by -email, -userid, and -cardnumber. Many external authorization systems have the authentication by phone number, which is also required for libraries.
Comment 1 Slava Shishkin 2023-12-20 15:02:44 UTC
Created attachment 160122 [details] [review]
Bug 35617: Extending the matchpoint in "identity_providers"            by phone number

Update identity_providers to include 'phone' as a matchpoint, 
also as option in the dropdown menu. Further when authentication 
phase 'phone' will be used as the matchpoint like email, userid, 
or cardnumber.
Comment 2 Slava Shishkin 2023-12-20 15:04:37 UTC
The new match point for -phone numbers will function exactly as the -email match point as it is implemented now in master with known imperfection: It is known that Koha does not check for email uniqueness for now even if it's a matchpoint, so same behavior present with a phone number field. Making Koha check for uniqueness for any of both fields is much more complicated architecture-wise and should be solved later as a separate task, but this does not limit current use for libraries that already have email or phone as matchpoints anyway.
Comment 3 Olivier Hubert 2024-09-26 19:21:27 UTC
Hi Slava,

I've worked with identity providers before so I'm willing to test this and sign it off. Do you think you could provide a step by step test plan? It would greatly speed up the process.
Comment 4 Slava Shishkin 2024-09-26 22:11:47 UTC
Hi Olivier! 

Thanks for your willingness to test.

Here is a brief plan for testing the patch. This will help verify that the "Matchpoint" field includes the "phone" option and that changes with this field are saved correctly:

1. Go to the "Identity providers" settings from the administration page.
2. Select "+ New identity provider".
3. Fill in the required fields with test data. You can use the "Add default OAuth configuration" and "Add default OAuth mapping" hints for the Configuration and Mapping fields, respectively.
4. Ensure that the "Matchpoint" field now has a new option — "phone", and select it.
5. Save the "Identity provider" settings.
6. Edit the newly created provider and verify that the settings are saved correctly.

Further testing requires an external provider that sends a phone number, such as a banking identity service.

I hope this helps!
Comment 5 Olivier Hubert 2024-09-27 18:01:06 UTC
I usually try and use Koha Testing Docker with Keycloak for testing SSO authentication and patches that touch on SSO. Can you look at https://wiki.koha-community.org/wiki/Testing_SSO#Keycloak and let me know if you think I could test the whole process, from adding the identity provider to authenticating with a user and having them match on Koha through their phone number?

Although the code change in Koha is relatively small and benign, I'm reluctant to sign off on your patch if I cannot test the entire workflow.