User login issues with OpenID

Re: User login issues with OpenID

by Elizabeth Smith -
Number of replies: 6
The user id 246 is the same user who's encountering this issue. I ran the query with id = '1' and got the normal results mentioned in your post. Then ran the query with user id = '246' and got the results for the information of the user who's experiencing this issue. Just in case, we did keep the admin level user that's set as manual. Whenever I delete the user the deleted value is changing from 1 to 0 in the DB. When the user is getting created they are getting assigned with a different ID. It almost seems like something is stuck in cache somewhere for this particular user's email address. I tried testing it from a different browser and machine but the same issue seems to be happening. The user's authentication method was original set to "Email-based self-registration" but so where the rest of the users that are able to login without any issues.
In reply to Elizabeth Smith

Re: User login issues with OpenID

by Ken Task -
Picture of Particularly helpful Moodlers

Don't think moodle caches user info ... it does keep track of sessions.  Is your site using DB for sessions or files?

Purge caches ... if using files for sessions, manually remove all session files in moodledata/sessions/  - that will force all users out and they will have to login again doing that.

Still ... the screen shot ... third line down said user with ID 1 (the guest user) *CREATED* user id 246.  Didn't think that possible unless user ID 1 has the ability to create.

Accounts set to manual are using moodle's own authentication ... openID the user info is coming from outside of Moodle.

So what does user id 246 look like at the other end ... then openid end?

'SoS', Ken


In reply to Ken Task

Re: User login issues with OpenID

by Elizabeth Smith -
I removed moodledata/sessions/ files and that forced all the users out. The user still had issues that they were logged in as guest. I noticed in the session file username was listed as 'guest user' for this particular user.

On the DB side the guest user is showing up as auth 'oidc' is this normal? I tried changing it to 'manual' just to see what would happen and when the user tried to login we got this error. It seems that the user and the guest account are somehow connected with each other. 

Attachment Annotation 2020-08-20 152410 (1).png
Attachment Annotation 2020-08-20 152410.png
In reply to Elizabeth Smith

Re: User login issues with OpenID

by Ken Task -
Picture of Particularly helpful Moodlers

When your moodle was first installed 2 users existed ... uid 1 was automatically guest and set to 'manual' ... there was a md5hashed password that equated to a blank password.

User ID 1 and User ID 2 (person that installed moodle and the first admin level account) should have been left to manual auth.

So back when you did this:

"I had to switch all the users authentication method to OpenID Connect"

Got you into this issue.   Guest and any admin level account using 'manual' should have been excluded from whatever you did to convert them all to openid.

You have to query the database for your moodle with a tool outside of Moodle Admin UX - don't think the admin UX will show guest and allow you to edit properly.

So using mysql client as an example and using the db for a moodle called 'moodle'.

mysql> select id,firname,lastname,email,password from mdl_user where id=1;

What do you see?

Do same for ID number 2.   Ditto.

'SoS', Ken

In reply to Ken Task

Re: User login issues with OpenID

by Elizabeth Smith -

Only certain user's authentication method were manually switched via the Admin UX. The admin account and some other test accounts were kept as 'manual'.  The guest user is not listed in the Admin UX, so it was never available to be switched. I reviewed the logs further for earlier dates before the change and looks like this user was going through the guest id '1' prior to switching the account. I noticed this was in the Guest user's logs with the user's IP that matches with the times the user has logged into the Moodle site. "Login failed for user 'USERNAME'. User does not exist (error ID '1')."

I ran the query, where id=1 and it displays only the Guest user account. Then ran, where id=2 that displayed only the Admin user. 

In reply to Elizabeth Smith

Re: User login issues with OpenID

by Ken Task -
Picture of Particularly helpful Moodlers

This posting:
https://moodle.org/mod/forum/discuss.php?d=407896#p1645973
showed "user with id 1 created the user with 246"

What are the capabilities of 'guest' account or id 1?
When was guest account modified timecreated and timemodified?

select id,username,firstname,lastname,email,timecreated,timemodified,lastip from mdl_user where id=1;

You may have discovered a bug which won't be fixed as the moodle is 3.6.2+

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: User login issues with OpenID

by Elizabeth Smith -
Issue was resolved by upgrading to 3.8. Thanks for your help on this issue.
Average of ratings: Useful (1)