# 是否可以通过 Discourse 对 WordPress 登录进行身份验证？

**URL:** https://meta.discourse.org/t/is-it-possible-to-authenticate-a-wordpress-login-via-discourse/126184
**Category:** SSO
**Created:** [2019年八月19日 15:12 UTC](https://meta.discourse.org/t/is-it-possible-to-authenticate-a-wordpress-login-via-discourse/126184 "2019-08-19T15:12:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Thomas\_Bergen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_bergen/32/153424_2.png) [@Thomas\_Bergen](https://meta.discourse.org/u/Thomas_Bergen)
#### Post date: [2019年八月19日 15:12 UTC](https://meta.discourse.org/t/is-it-possible-to-authenticate-a-wordpress-login-via-discourse/126184/1 "2019-08-19T15:12:32Z")

</div>

大家好，

我目前正在开发一款应用，需要从 WooCommerce 网站和 Discourse 获取数据。因此，如果可能的话，我需要一种方式来实现单点登录（SSO），以便获取用户的 WordPress 信息（我目前可以通过连接到客户 WordPress 网站的插件获取）以及用户的 Discourse 信息。有人告诉我 Discourse 可能有某种功能可以帮助实现这一点，但我不太清楚在哪里找到它。这是否可行？如果可行，有什么建议吗？

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2019年八月19日 15:44 UTC](https://meta.discourse.org/t/is-it-possible-to-authenticate-a-wordpress-login-via-discourse/126184/2 "2019-08-19T15:44:16Z")

</div>

用搜索吧，卢克。

> [@Install and configure the WP Discourse Wordpress plugin for Discourse](https://meta.discourse.org/t/wp-discourse-plugin-installation-and-setup/50752):
>
> To get started with the WP Discourse Plugin, go through each of these topics in order and watch the videos at the top of the topic. [Install the plugin](https://meta.discourse.org/t/install-the-wp-discourse-plugin/223489/1)[Connect to Discourse](https://meta.discourse.org/t/connect-wp-discourse-to-discourse/223490/1)[Set up Publishing](https://meta.discourse.org/t/wp-discourse-and-publishing-posts-to-discourse/223492/1)[Set up Commenting](https://meta.discourse.org/t/wp-discourse-and-commenting/223493/1)[Set up DiscourseConnect](https://meta.discourse.org/t/wp-discourse-and-discourseconnect/223494/1) The two main plugin features, Publishing and [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) don’t have to be used together. You can just set up Publishing (and Commenting), and not use [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true), or just set up [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true), or set up both. There’s a short description of each featu…

> [@WP Discourse plugin tips and tricks](https://meta.discourse.org/t/wp-discourse-plugin-tips-and-tricks/50757):
>
> This topic has a number of tips and tricks for users of the [WP Discourse](https://github.com/discourse/wp-discourse) WordPress plugin. Adjust the comments\_number sync period for WordPress archive pages To get the correct number of Discourse comments for a post, the plugin needs to periodically make an HTTP request to Discourse to get the current comments number. On single pages this period is set to be no more often than every 10 minutes. For archive pages the period is set to no more than once every 24 hours. The reason for this is to a…

---

<div class="post-metadata">

### Author: ![youderian](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/youderian/32/114512_2.png) [@youderian](https://meta.discourse.org/u/youderian)
#### Post date: [2019年八月19日 15:50 UTC](https://meta.discourse.org/t/is-it-possible-to-authenticate-a-wordpress-login-via-discourse/126184/3 "2019-08-19T15:50:13Z")

</div>

@Thomas_Bergen 是的，完全可行。我们将 WordPress 用作整个社区的 SSO 代理，结合上述插件和 Discourse 强大的 API，我们从未遇到过任何问题，运行效果非常好。
