Bug 40728

Summary: Auto register creates patrons with the default category and default library
Product: Koha Reporter: Koha collecto <koha>
Component: AuthenticationAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: dpavlin
Version: 24.05   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Koha collecto 2025-08-28 19:52:35 UTC
With OIDC protocol, if we activate auto register, the patrons that log in Koha with Microsoft for the first time are created with the default category and the default library, chosen in the identity provider's settings, no matter what category/library they have in Microsoft.

The category and the library info from Microsoft are updated only when the patrons log in a second time in Koha, if update on login is also activated.


To test :
1. Add an identity provider with OIDC protocol. Make sure to have an attribute in the Entra ID for both the category and the library and that they are mapped correctly.
2. Activate auto register and update on login.
3. Make sure the default category and the default library is different than what you have in the Microsoft account used for the test.
4. Log in for the first time and check that the patron is created in Koha. The library and the category are what you have in the default settings from the identity provider.
5. Log off and log in again in Koha using the same Microsoft accout. The library and the category will be updated to what you have in Microsoft.