# Routing from SSO server to forum as logged in

**URL:** https://meta.discourse.org/t/routing-from-sso-server-to-forum-as-logged-in/92497
**Category:** SSO
**Created:** [16 ביולי,‏ 2018,‏ 9:26pm UTC](https://meta.discourse.org/t/routing-from-sso-server-to-forum-as-logged-in/92497 "2018-07-16T21:26:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jehrlich](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jehrlich](https://meta.discourse.org/u/jehrlich)
#### Post date: [16 ביולי,‏ 2018,‏ 9:26pm UTC](https://meta.discourse.org/t/routing-from-sso-server-to-forum-as-logged-in/92497/1 "2018-07-16T21:26:26Z")

</div>

Assuming I implement an SSO server on my application, and have a logged-in user.

The SSO site has a link to the forum, and a logged-in user should be logged in to the forum as well when it is clicked. The user should not have to click anything on the forum to see posts with appropriate group privileges.

Can this be done? How?

If I also implemented an OAuth server would that change things? I’m guessing not because SSO and OAuth are not compatible. Right?

Maybe I just implement the Oauth server. Then, can I disable account creation through the forum interface? Alternatively, use group privileges that are only available through my Oauth server?

This must be a common use-case. What is best to make it all transparent to the user?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [16 ביולי,‏ 2018,‏ 9:46pm UTC](https://meta.discourse.org/t/routing-from-sso-server-to-forum-as-logged-in/92497/2 "2018-07-16T21:46:56Z")

</div>

> [@jehrlich](#):
>
> The SSO site has a link to the forum, and a logged-in user should be logged in to the forum as well when it is clicked. The user should not have to click anything on the forum to see posts with appropriate group privileges.

Create a link on the SSO Provider site that points to `/session/sso`. Set the `return_path` parameter to send the user to a particular page on the forum. If the user is already logged in on the SSO provider site, they will be automatically logged in and redirected to the `return_path`. If the user is not logged in on the SSO provider site, clicking the link will initiate the SSO login process.

```plaintext
<a href="https://forum.example.com/session/sso?return_path=https://forum.example.com/t/the-topic-slug/1234">Your Link Text</a>

```
