Login session timeout while trying to implement with SSO

AI-generated summary

A user, ujjawal0911, is experiencing a login session timeout issue while trying to implement Single Sign-On (SSO) with Discourse for their React frontend and Django backend application. The SSO process involves the frontend making an API call to the backend, which redirects to the discourse_connect_url for authentication, then sends the return_url back to the frontend. Despite this process taking only a second, a session timeout error occurs.

ujjawal0911 confirmed that both servers’ clocks are correct, and pfaffman suggested checking for any hostname discrepancies that could be causing the redirect issue.

So our frontend is React and Backend is Django and we want to use Discourse as a discussion platform for our application. The problem is whenever our backend API returns the redirected URL, it return login timeout even though the entire process takes hardly a second to complete.

The methodology is as follows:

  • The frontend makes an API call to the backend when it is triggered for opening the discussion forum.
  • The backend then makes a request to Discourse which is redirected to the discourse_connect_url along with the payload and signature.
  • The authentication happens.
  • The return_url is then sent back to the first API call which made the request, which then sends it back to the frontend as JSON response.

On trying to access the URL it gives session timeout. Even if I just try to access the URL as soon as it is created it just gives login timeout error. Is the approach bad? What is going wrong?

Are both servers clock correct?

Yes, the time on both the servers are the same.

Is some hostname subtly different somehow and you’re redirecting to the wrong hostname and that’s why it can’t connect? (Seems improbable, but that’s all I’ve got.)