OpenID Connect: create and match users

OpenID Connect: create and match users

by Anton Tremetzberger -
Number of replies: 3
Picture of Particularly helpful Moodlers

Dear Community,

we are testing OpenID Connect with Moodle 3.5.7+. In the Sync Settings I can enable/disable some sync features.

Although I disabled "Create accounts in Moodle fro users in Azure AD", a non-existing user in Moodle will be created during the login. I just wan't to create new users only via cron job. How can I prevent Moodle to create a user during the first login?

We also have pre-existing users in Moodle (mostly LDAP users, but also some local users). I have a local user (username = janedoe) and also an Azure-User (username = janedoe@xxx.onmicrosoft.com). If I enable "Match preexisting Moodle users with same-named accounts in Azure AD" and "Switch matched users to Office 365 (OpenID Connect) authentication" normally the local user must be switched automatically to an Azure-User. But nothing happens, Moodle will create a new Azure-user and don't match the existing user. How can I force Moodle to match the user?

thanks, best regards
Anton

Average of ratings: -
In reply to Anton Tremetzberger

Re: OpenID Connect: create and match users

by Ramzi Hosni -

Hello Anton,

I have the same problem, could you please share the solution if you have figured it out?

Thank you in advance

In reply to Ramzi Hosni

Re: OpenID Connect: create and match users

by Anton Tremetzberger -
Picture of Particularly helpful Moodlers

Dear Ramzi,

to prevent creating new users during the login it was only a setting in Moodle: we enabled "Prevent account creation when authenticating (authpreventaccountcreation)" in Site admnistration - plugins - authentication.

The problem with matching preexisting Moodle-Users with Azure AD-Users still exists. We have found another solution by changing the entries directly in the Moodle Database:

  • change all login-names from eg. janedoe to janedoe@xxx.onmicrosoft.com
  • change authentication method from ldap to oidc


best regards,
Anton