# 从 SSO 服务器以登录状态路由到论坛

**URL:** <https://meta.discourse.org/t/routing-from-sso-server-to-forum-as-logged-in/92497>\
**Category:** SSO\
**Created:** [2018 年7 月 16 日 21:26 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:** 1\
**Showing post:** 2

<div class="post-metadata">

作者： ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
发布日期： [2018 年7 月 16 日 21:46 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>

```

---

_[View the full topic](https://meta.discourse.org/t/routing-from-sso-server-to-forum-as-logged-in/92497)._
