# Login session timeout while trying to implement with SSO

**URL:** https://meta.discourse.org/t/login-session-timeout-while-trying-to-implement-with-sso/240417
**Category:** SSO
**Created:** [September 29, 2022, 6:53pm UTC](https://meta.discourse.org/t/login-session-timeout-while-trying-to-implement-with-sso/240417 "2022-09-29T18:53:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ujjawal0911](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ujjawal0911/32/274970_2.png) [@ujjawal0911](https://meta.discourse.org/u/ujjawal0911)
#### Post date: [September 29, 2022, 6:53pm UTC](https://meta.discourse.org/t/login-session-timeout-while-trying-to-implement-with-sso/240417/1 "2022-09-29T18:53:41Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [September 29, 2022, 6:55pm UTC](https://meta.discourse.org/t/login-session-timeout-while-trying-to-implement-with-sso/240417/2 "2022-09-29T18:55:44Z")

</div>

Are both servers clock correct?

---

<div class="post-metadata">

### Author: ![ujjawal0911](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ujjawal0911/32/274970_2.png) [@ujjawal0911](https://meta.discourse.org/u/ujjawal0911)
#### Post date: [September 29, 2022, 7:11pm UTC](https://meta.discourse.org/t/login-session-timeout-while-trying-to-implement-with-sso/240417/4 "2022-09-29T19:11:35Z")

</div>

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

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 29, 2022, 8:18pm UTC](https://meta.discourse.org/t/login-session-timeout-while-trying-to-implement-with-sso/240417/5 "2022-09-29T20:18:42Z")

</div>

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