Hi all,
I'm using Moodle 4.5 and auth_oauth2 with Azure AD. We've switched over from using LDAP so have many existing accounts in which we've updated the usernames (to match Azure AD format) and auth types as appropriate.
Some users have more than one account (intentionally), and in many cases use the same email address for both - we've not previously required emails to be unique but are moving that way!
When users log in via SSO for the first time it is matching AD accounts to existing Moodle accounts that have the same email address rather than accounts that have the same username - this often ends up linking the SSO login to the wrong Moodle account.
Is there a way we can change this initial match behaviour to using username?
many thanks