OIDC Error - "The existing token for this user does not contain a valid user ID"

OIDC Error - "The existing token for this user does not contain a valid user ID"

by Eli Fadida -
Number of replies: 2

Hello Comunity, need your help with this plugin.

Runnig moodle 3.9.1 and oidc for authentication, new users cannot sign in
(current users can).

New (first time) users are forwarded to office365 login page, in the first try get the following error: "Error in API call: Insufficient privileges to complete the operation"

and then with every retry : "The existing token for this user does not contain a valid user ID"

Checked "auth_oidc_token" table, i see they get userid=0,
when checking the "users" table, they are not listed there at all

Deleting the userid=0 records from "auth_oidc_token" does not help, they get the same error and are again created only in the "auth_oidc_token" table.

To complete the picture
I have another moodle site with same configurations (as far as i can see) that seems to work fine (for same users)

Any Idea where to start ?

Average of ratings: -
In reply to Eli Fadida

Re: OIDC Error - "The existing token for this user does not contain a valid user ID"

by Eli Fadida -
Update:
As i couldnt find the issue / solution, i have copied the older auth/oidc folder I had on a different serve (older version) and it works, users can be added and they get a proper userid
.
Modle now prompts me to update the o365 as a mandatory update, but ill try to solve the issue before upgrading it.
Older (now installed) version:
$plugin->version = 2019052005; , $plugin->requires = 2019052000; , $plugin->release = '3.7.0.5';

Newer(not working for me) version:
$plugin->version = 2020071500; $plugin->requires = 2020061500; $plugin->release = '3.9.0';

Moodle server version: 3.9.1+ (Build: 20200730)

If you have any insight / idea please share.
In reply to Eli Fadida

Re: OIDC Error - "The existing token for this user does not contain a valid user ID"

by Francela Jiménez -
did you fix this problem?