# TownNews CMS 的单点登录 (SSO)

**URL:** <https://meta.discourse.org/t/sso-with-townnews-cms/144735>\
**Category:** SSO\
**Created:** [2020年三月18日 16:46 UTC](https://meta.discourse.org/t/sso-with-townnews-cms/144735 "2020-03-18T16:46:28Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [2020年三月18日 18:14 UTC](https://meta.discourse.org/t/sso-with-townnews-cms/144735/4 "2020-03-18T18:14:46Z")

</div>

> [@Michael\_Greathouse](#):
>
> 我指的是使用 Townnews 作为 SSO 来源。

这意味着 Townnews 将作为您 Discourse 网站的 SSO 提供商。要使用 Discourse 的 SSO 实现，您需要能够在充当 SSO 提供商的服务中添加代码。该代码需要与该服务的登录流程挂钩。有关需要添加的代码的详细信息，请参见此处：[Discourse 官方单点登录 (SSO)](https://meta.discourse.org/t/official-single-sign-on-for-discourse-sso/13045)。

要查看可运行的代码示例，请查看我们的 WordPress 插件如何实现 SSO：[https://github.com/discourse/wp-discourse/tree/master/lib/sso-provider。](https://github.com/discourse/wp-discourse/tree/master/lib/sso-provider%E3%80%82)

此外，也可能通过 OAuth2 使用 Townnews 将用户登录到 Discourse。如果 Townnews 能够充当 OAuth2 提供商，则这是可行的。有关在 Discourse 中设置 OAuth2 登录的详细信息，请参见此处：[OAuth2 基本支持](https://meta.discourse.org/t/oauth2-basic-support/33879)。在投入过多时间之前，最好先确认 Townnews 是否能够充当 OAuth2 提供商。这应该可以通过查阅其文档来确认。

---

_[View the full topic](https://meta.discourse.org/t/sso-with-townnews-cms/144735)._
