# SSO login broken when following a shared link?

**URL:** https://meta.discourse.org/t/sso-login-broken-when-following-a-shared-link/45134
**Category:** Support
**Created:** [June 2, 2016, 1:16pm UTC](https://meta.discourse.org/t/sso-login-broken-when-following-a-shared-link/45134 "2016-06-02T13:16:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Kevin\_McKinney](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kevin_mckinney/32/54497_2.png) [@Kevin\_McKinney](https://meta.discourse.org/u/Kevin_McKinney)
#### Post date: [June 2, 2016, 1:16pm UTC](https://meta.discourse.org/t/sso-login-broken-when-following-a-shared-link/45134/1 "2016-06-02T13:16:07Z")

</div>

I’ve set up SSO for my Discourse instance at my company, so that users can log in with Windows authentication against our internal Active Directory. This has worked fine so far.

What I noticed today is that when I email a link to people which is a shared link from a topic I created, there are problems logging in **if they followed that link.**

Here are some relevant pieces of info:

Root URL: `http://{computer_name}`  
Shared link: `http://{computer_name}/t/expand-code-n-lines/278?u=kmckinney`

When I click Login, my browser URL reflects this, but doesn’t log me in.

`http://{computer_name}/t/expand-code-n-lines/278?u=kmckinney/session/sso_login?sso={sso_payload}`

If I then go to the root URL for the site, I’m able to log in without a problem, and then I can follow the link and view the post as a logged in user.

Please let me know if there is more info that I should provide. Thanks!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 2, 2016, 5:55pm UTC](https://meta.discourse.org/t/sso-login-broken-when-following-a-shared-link/45134/2 "2016-06-02T17:55:18Z")

</div>

@techapj can we repro this on a customer that uses SSO?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [June 3, 2016, 4:46pm UTC](https://meta.discourse.org/t/sso-login-broken-when-following-a-shared-link/45134/3 "2016-06-03T16:46:14Z")

</div>

Not able to repro this on [http://forums.gearboxsoftware.com](http://forums.gearboxsoftware.com)

---

<div class="post-metadata">

### Author: ![Kevin\_McKinney](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kevin_mckinney/32/54497_2.png) [@Kevin\_McKinney](https://meta.discourse.org/u/Kevin_McKinney)
#### Post date: [August 15, 2016, 7:07pm UTC](https://meta.discourse.org/t/sso-login-broken-when-following-a-shared-link/45134/4 "2016-08-15T19:07:54Z")

</div>

> [@techAPJ](#):
>
> Not able to repro this on [http://forums.gearboxsoftware.com](http://forums.gearboxsoftware.com)

I realized what the issue was, and it is _ **not** _ an issue with Discourse. My hacked-together SSO provider site (so users could authenticate against our internal Active Directory) was redirecting incorrectly. 😳

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [August 15, 2016, 7:09pm UTC](https://meta.discourse.org/t/sso-login-broken-when-following-a-shared-link/45134/5 "2016-08-15T19:09:19Z")

</div>


