Remove @domain.com from UPN during authentication #2306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is part of an alternative solution to the request for using the sAMAccountname from AD.
#2157
#2212
This pull requests add an option to the authentication plugin to remove the @domain.com portion of a person's username found in the claim information. The new "stripped" username is then used to match a corresponding Moodle user. This is useful for organizations that need the Moodle username to remain in the sAMAccountname format for 3rd party integrations.
The usersync code of the o365 plugin already has a code snippet where it splits the user's UPN for matching it to a Moodle username. This request borrows that code and adds it to the OIDC authentication plugin.
o365-moodle/local/o365/classes/feature/usersync/main.php
Lines 991 to 995 in 254fce2