I set up my moodle 3.6.3 with both Microsoft OAuth2 and LDAP as authentication methods.
For my organization, every staff has an O365 email account and another LDAP user account. My LDAP server holds the user information with e-mail addresses, which are the same as their O365 email accounts.
However, the user name of LDAP user account is the user's staff ID, which is different from user's O365 email address.
Now, the problem is, when a new staff first logins with his/her email address using OAuth2 method, the login is successful and moodle creates a new user record in the database. Then afterwards, when he/she logouts but logins again with his/her staff ID using LDAP method, the login is also successful but moodle creates another new user record in the database. Thus, a single staff has two user records.
Is there any method to merge the new LDAP user login with his/her previous OAuth2 login in moodle?
Your feedback is highly appreciated.
Thank you very much.