Moodle and O365 session timeout issue

Moodle and O365 session timeout issue

by Anthony Connor -
Number of replies: 1

Hi,


We are using the openID connect plugin from the O365 suite of plugins for authentication in our site for a few months. All went well in testing and in the early days but we have noticed an issue with users being continually kicked out of moodle and returned to the login page with a session timeout error. The timeout in moodle is set to 3 hours but users are being kicked out every few minutes. Our accounts are in AzureAD and users are directed to our adfs site to enter credentials. We are using moodle 3.0.4+ on a LAMP stack. 

Has anybody come across an authentication issue like this with O365 with moodle?

Average of ratings: -
In reply to Anthony Connor

Re: Moodle and O365 session timeout issue

by Anthony Connor -

We see this error from time to time:


moodle_exception


moodle_exception."Unknown state." thrown in /var/www/elearning.ait.ie/auth/oidc/classes/Ioginflow/authcode.php on line 148

at auth_oidc\loginflow\authcode.handleauthresponse(loginflow/authcode.php:79)

at auth_oidc\loginflow\authcode.handleredirecuoidc/authphp:1 05)


at authjluginpidc.handleredirecuoidc/index.php:29)

at .{main}(loginflow/authcode.php:148)



In the authcode.php class the method responsible for line 148 is titled 'Validate and expire state'. From what i can see this method throws an errorauthunknownstate exception if the auth_oidc_state record in the DB is empty. This may be causing the session timeout error we are seeing for our users. 


Does anybody have any pointers?