Login session timeout while trying to implement with SSO

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?

1 Like

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.)