Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile field mapping function called twice on each successful auth_oidc user login #1437

Closed
weilai-irl opened this issue Oct 16, 2020 · 1 comment · Fixed by #1439 or #1440
Closed
Assignees
Labels
Issue type - bug Bugs in existing code that needs to be fixed. Triaging status - triaged A ticket has been created accordingly in the maintainers' ticket system.

Comments

@weilai-irl
Copy link
Collaborator

In pull requests #1197, which was used as base for #1290 and #1291, introduced a logic in which profile field mapping is called directly within the login process of an auth_oidc user, to fix an issue in which newly created Moodle account from initial login misses necessary profile data. This caused the field mapping function being called twice - the first time in auth_oidc plugin, and a second time in the observer function in local_o365 that listens for user logged event. This is wrong, and may cause performance issue, and may even result in throttling in Graph API calls in extreme cases.

I'd like to propose a solution here, to keep the call to the function to field mapping function in auth_oidc plugin, and update the call in the observer function to only run if the user doesn't have auth_oidc set as authentication method. This would be a user who doesn't use auth_oidc authentication type, but is matched to an Azure account. Field mapping needs to run for such users, and it is not triggered as part of their login.

This fix will be included in the next release.

@weilai-irl weilai-irl added this to the Release 2020-11 milestone Oct 16, 2020
@weilai-irl weilai-irl self-assigned this Oct 16, 2020
@nenorojas nenorojas added Issue type - bug Bugs in existing code that needs to be fixed. Triaging status - triaged A ticket has been created accordingly in the maintainers' ticket system. labels Oct 19, 2020
@weilai-irl
Copy link
Collaborator Author

This has been included in the latest release of the plugins (3.8.0.5 and 3.9.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue type - bug Bugs in existing code that needs to be fixed. Triaging status - triaged A ticket has been created accordingly in the maintainers' ticket system.
Projects
None yet
2 participants