Office 365 Athentication creates new users

Office 365 Athentication creates new users

by Thomas College -
Number of replies: 1

We've added OpenID Connect and Microsoft Office 365 Integration plugins to our Moodle instance and set the configuration per Microsoft's guide.  When users login via the OpenID Connect plugin, a new user is created in the Moodle database, rather than logging that user in to their existing account.  Is this to be expected?  If not, has any one else experienced this problem, and if so, discovered a solution?

Thanks

Average of ratings: -
In reply to Thomas College

Re: Office 365 Athentication creates new users

by Ken Task -
Picture of Particularly helpful Moodlers
Yes, experienced something very similar using an Oauth2 auth plugin for Google.

The good news is that the O365 authentication is working!   So congrats.

The bad news might be ...

Users that exist in the mdl_user table have an 'auth' set to whatever/however they were authenticating before - manual/ldap or whatever.   Thus when adding another auth method new accounts under the new method, like openID, might actually have something like: social_user_1 (or some #) as the username ... as opposed to what they had before.   Thus, there are two accounts for same person.  The initial account is the one assigned to students and enrolled in courses, etc.

Fix is to: backup the DB.   Then change the auth for current account to the openID variable.   That assumes that all other info: firstname, lastname, etc. is the same.

So check your mdl_user table and see what's there.   The fix might be changing existing accounts via CSV method.

'spirit of sharing', Ken