SSO Plugin Account login timed out, please try logging in again

I have a link that goes directly to{username}/messages.

If it has been a while since visiting that link the user will get “Account login timed out, please try logging in again.” If I visit the exact link again, the user is successfully logged in and I do not receive the error message. My question is: if the account login is timed out, why doesn’t the discourse system go ahead and call my external sso url like it does the second time? It’s as if, first, the user has to attempt going to a url in discourse and get the error message. Discourse notices and saves some setting. The second time, discourse knows the user is logged out and correctly calls the sso flow. Why can’t it immediately call the sso flow and skip the “Account login timed out” error? In fact, it seems in previous versions of Discourse I did not have this problem.

I don’t know – I suggested doing this here:

@fefrei You still have not found a solution?

I’m not suffering from this – it was just a recommendation from me, hoping to be picked up by the Discourse team :slight_smile:

Oh, well that is good you’re not dealing with this. It is not a good user experience.

I am experiencing this same issue with my own SSO server running that’s providing authentication for other services, as well as Discourse.

Have you come across a solution for this for yourself?

I was running multiple containers taking SSO requests. I was retaining a bit of state between requests and if a single user jumped between containers, I lost the state I needed and received the error. Temporarily I scaled down to one container.

1 Like

I would very much like this to be fixed as it’s pretty confusing for the average user (as they have to reload the browser page to log back in).

I’ve just add discourse forum to my web site and enable sso-login. Users have this error on every new login try while login takes 5-10 seconds not 10 min. After clicking my logo or reload the page user is logged in. Please advice how to solve this problem. It’s bad UX and confusing for users

I’ve fixed it. The problem was the next:
My client is react app and the redirect to forum with payload to log in is located in componentDidUpdate lifecycle method of some high-order component. For every login attempt this redirect was fired twice - so first one was successful, while the second one with the same nonce got error because nonce was already expired after the first one. As a result user actually was logged in but saw the error “Account login timed out, please try logging in again”


I have the similar problem with SSO plugin login. It doesn’t always happen. Does anyone have solution for this?