microsoft / o365-moodle

Office 365 and Azure Active Directory plugins for Moodle
GNU General Public License v3.0
182 stars 136 forks source link

Poor error when attempting to log in as an administrator #1177

Closed swinster closed 2 years ago

swinster commented 4 years ago

Just noted that some cached credentials from my Azure or O365 admin login caused a horrible error:


There was a problem logging you in. Please contact your administrator for assistance.

More information about this error Debug info: 2 Error code: errorauthgeneral Stack trace:

line 494 of /auth/oidc/classes/loginflow/authcode.php: moodle_exception thrown
line 269 of /auth/oidc/classes/loginflow/authcode.php: call to auth_oidc\loginflow\authcode->handlelogin()
line 107 of /auth/oidc/classes/loginflow/authcode.php: call to auth_oidc\loginflow\authcode->handleauthresponse()
line 105 of /auth/oidc/auth.php: call to auth_oidc\loginflow\authcode->handleredirect()
line 29 of /auth/oidc/index.php: call to auth_plugin_oidc->handleredirect() 

image

The link directs you to https://docs.moodle.org/36/en/error/auth_oidc/errorauthgeneral, which doesn't exist.

swinster commented 4 years ago

Still seeing this

swinster commented 4 years ago

I tried to create a new admin user , but can't seem to unlink the old one. Therefore we are now getting:

Output buffer: <div class="notifytiny debuggingmessage" data-rel="debugging">Error: mdb->get_record() found more than one record!<ul style="text-align: left" data-rel="backtrace"><li>line 1599 of /lib/dml/moodle_database.php: call to debugging()</li><li>line 400 of /auth/oidc/classes/loginflow/authcode.php: call to moodle_database->get_record_sql()</li><li>line 452 of /auth/oidc/classes/loginflow/authcode.php: call to auth_oidc\loginflow\authcode->check_objects()</li><li>line 269 of /auth/oidc/classes/loginflow/authcode.php: call to auth_oidc\loginflow\authcode->handlelogin()</li><li>line 107 of /auth/oidc/classes/loginflow/authcode.php: call to auth_oidc\loginflow\authcode->handleauthresponse()</li><li>line 165 of /auth/oidc/auth.php: call to auth_oidc\loginflow\authcode->handleredirect()</li><li>line 29 of /auth/oidc/index.php: call to auth_plugin_oidc->handleredirect()</li></ul></div>

Checking out the MS365 pluggin --> Manage User Connections we see:

image

swinster commented 4 years ago

I could not seemingly unlink the original default admin user from the OpenID login no matter what I did. I eventually deleted the new user, renamed the old admin user account to the name of the Azure AD user, resynced, then finally could log in rising OpenID Connect.

weilai-irl commented 2 years ago

Hi @swinster,

Sorry for taking so long to get back to you.

Could you explain how this issue can be reproduced please. I suppose it's not specific to admin account, rather it's about the ability to unlink any account? I'm wondering how these accounts are connected in the first place.

Regards, Lai

swinster commented 2 years ago

Unfortunately, I can't reproduce as we were forced to move away from Moodle.

weilai-irl commented 2 years ago

Sorry to see you moved away from Moodle. I'll close this issue in that case as I can't reproduce it either.