# Detecting user already logged in when using SSO

**URL:** <https://meta.discourse.org/t/detecting-user-already-logged-in-when-using-sso/26968>\
**Category:** Feature\
**Tags:** sso, discourseconnect\
**Created:** [30 Marzo, 2015 00:21 UTC](https://meta.discourse.org/t/detecting-user-already-logged-in-when-using-sso/26968 "2015-03-30T00:21:02Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tomdcc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tomdcc/32/115890_2.png) [@tomdcc](https://meta.discourse.org/u/tomdcc)\
**Post date:** [30 Marzo, 2015 00:21 UTC](https://meta.discourse.org/t/detecting-user-already-logged-in-when-using-sso/26968/1 "2015-03-30T00:21:02Z")

</div>

Hi all

We are using the SSO mechanism, which is working great, with one exception.

If a user is logged in to our main site, then clicks a link to go to the forums, they are not logged in when they hit Discourse. They then hit login and transparently become logged in. This is a bit confusing.

It would be nice if Discourse could detect that the user is logged in to the main site. There are a couple of ways that this could be done, but the most straight forward is a redirect of all non-logged-in users via an SSO URL which will return indicating whether the user is logged in or not. This URL could be the existing SSO url with a parameter to indicate that a reply should come immediately even if the user isn’t logged in, or it could be a completely separate URL. Given that the reply in the case of the user being logged in should look like the reply for a successful SSO login, my gut feel would be to hit the same SSO URL with an extra parameter.

This behaviour could then be optionally enabled via a flag in the settings, maybe “Immediate SSO Login Check” or something like that.

Thoughts?

Thanks

Tom

---

_[View the full topic](https://meta.discourse.org/t/detecting-user-already-logged-in-when-using-sso/26968)._
