# 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:** [2015 年 3 月 30 日午前 12: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:** 3

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2015 年 3 月 30 日午前 12:37 UTC](https://meta.discourse.org/t/detecting-user-already-logged-in-when-using-sso/26968/3 "2015-03-30T00:37:15Z")

</div>

to do this cleanly and transparently we would need to add a special query param that you understand like say `?checkonly` that forces you to always redirect back and then do some iframe magic, either that or:

1. have your main site allow XHR from the discourse site and simply do a json call.
2. you add a jsonp endpoint and use that for the test

regardless pulling this off is technically a bit tricky, not that I am against it.

---

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