# What is the best SSO approach?

**URL:** <https://meta.discourse.org/t/what-is-the-best-sso-approach/73462>\
**Category:** WordPress\
**Created:** [November 5, 2017, 3:29pm UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462 "2017-11-05T15:29:15Z")\
**Posts on this page:** 12\
**Page:** 1

## AI-generated summary

In a discussion titled "What is the best SSO approach?" under the WordPress category, [dylanb](/t/-/73462/1) seeks advice on consolidating a fragmented login system involving Disqus, Discourse, WordPress memberships, and Patreon OAuth. He considers using WordPress as the SSO provider due to its membership features, despite documentation suggesting Discourse as the preferred SSO provider when it’s the primary platform. [HAWK](/t/-/73462/2) and [simon](/t/-/73462/3) agree that WordPress as SSO makes sense if it manages memberships, and confirm it won’t break existing Discourse users. However, [simon](/t/-/73462/6) clarifies that with WordPress as SSO, users can only log in via WordPress — not Discourse directly. [dylanb](/t/-/73462/5) worries about forcing existing Discourse users to create new WordPress accounts. [simon](/t/-/73462/8) suggests exporting Discourse users to CSV and importing them into WordPress, but [omarfilip](/t/-/73462/9) notes passwords aren’t exported, requiring password resets or assigned passwords emailed to users. [dylanb](/t/-/73462/10) finds plugins that auto-send reset emails, but [omarfilip](/t/-/73462/11) warns of potential email deliverability issues at scale, suggesting using Mailchimp with merge tags for personalized password emails. Finally, [dylanb](/t/-/73462/12) reconsiders using Discourse as SSO, allowing forum signups and syncing accounts via email, with WP users optionally logging in via Discourse — though new WP users wouldn’t auto-get Discourse accounts, which he sees as a significant drawback.

<div class="post-metadata">

**Author:** ![dylanb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanb/32/139102_2.png) [@dylanb](https://meta.discourse.org/u/dylanb)\
**Post date:** [November 5, 2017, 3:29pm UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/1 "2017-11-05T15:29:15Z")

</div>

I have created a bit of a mess with logins from various different services on my website and am working to consolidate things.

Currently, I have Disqus Comments, Discourse Forum, WordPress Users (for subscriptions/membership) and legacy users that login to both WordPress and Discourse through Patreon (OAuth).

Safe to say, it is all a bit messy.

My plan is to consolidate the comments into Discourse, but I want to consolidate the WP/Discourse users as best as possible. My gut tells me that I need to use WP as the SSO Provider because of the membership features that I’m using on the WP site, but overall I am definitely not sure. If I do that, users could sign in to read content on the main page and click to join the discussion and be good to go.

The documentation also recommends doing the opposite, but that seems to assume that Discourse is the main tool. Am I going to create problems for current Discourse users if I use WP?

Any pros/cons or suggestions here?

---

<div class="post-metadata">

**Author:** ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)\
**Post date:** [November 5, 2017, 5:35pm UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/2 "2017-11-05T17:35:09Z")

</div>

> [@dylanb](#):
>
> I need to use WP as the SSO Provider because of the membership features that I’m using on the WP site

Yes – if WP is handling membership records then this makes sense.

> [@dylanb](#):
>
> Am I going to create problems for current Discourse users if I use WP?

Nope!

---

<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:** [November 5, 2017, 8:27pm UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/3 "2017-11-05T20:27:35Z")

</div>

I think you’re on the right track. I’m wondering where you’re seeing this:

> [@dylanb](#):
>
> The documentation also recommends doing the opposite, but that seems to assume that Discourse is the main tool.

---

<div class="post-metadata">

**Author:** ![dylanb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanb/32/139102_2.png) [@dylanb](https://meta.discourse.org/u/dylanb)\
**Post date:** [November 5, 2017, 10:05pm UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/4 "2017-11-05T22:05:00Z")

</div>

Seems like there were a couple places that suggest using Discourse as the SSO provider is better since Discourse has a stronger user management platform. I.e.: “Note: Discourse has a very good user management system. Don’t enable this setting unless you have a reason to manage your users through WordPress.”

Then again, my use case seems to qualify as a ‘reason’ so that makes sense too. Just didn’t want to mistakenly go down the wrong path.

---

<div class="post-metadata">

**Author:** ![dylanb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanb/32/139102_2.png) [@dylanb](https://meta.discourse.org/u/dylanb)\
**Post date:** [November 10, 2017, 1:33am UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/5 "2017-11-10T01:33:24Z")

</div>

So is it possible to use WP as a SSO provider (auto login potentially) and then still have Discourse users be able to login (via Discourse) to the forum without creating a WP account?

I’m guessing this is a one or another, but maybe I’m missing something.

---

<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:** [November 10, 2017, 1:37am UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/6 "2017-11-10T01:37:52Z")

</div>

No, with WordPress as the SSO provider, users can only login and create accounts through WordPress.

---

<div class="post-metadata">

**Author:** ![dylanb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanb/32/139102_2.png) [@dylanb](https://meta.discourse.org/u/dylanb)\
**Post date:** [November 10, 2017, 1:59am UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/7 "2017-11-10T01:59:16Z")

</div>

Thanks, that makes sense now that I think about it.

Would be hard to explain to all of the previous Discourse users that they need to create a new account, etc. Seems like I’m going for the best of both worlds when I can only get one.

Is there any sort of best practice to migrate Discourse users to WP/auto create accounts or allow users to login to WP with their Discourse creds and create an account? Probably not because the Discourse auth would be turned off, right?

---

<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:** [November 10, 2017, 2:14am UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/8 "2017-11-10T02:14:00Z")

</div>

Probably the easiest approach would be to export the user data from Discourse and then import it into WordPress. You can export a CSV file of Discourse users through the admin section. There are WordPress plugins for importing users.

---

<div class="post-metadata">

**Author:** ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)\
**Post date:** [November 10, 2017, 3:04am UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/9 "2017-11-10T03:04:29Z")

</div>

The csv export doesn’t include passwords, so you’d have to have users go through a password reset routine or assign passwords during the csv import and email them to your users.

---

<div class="post-metadata">

**Author:** ![dylanb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanb/32/139102_2.png) [@dylanb](https://meta.discourse.org/u/dylanb)\
**Post date:** [November 10, 2017, 6:40pm UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/10 "2017-11-10T18:40:26Z")

</div>

> [@omarfilip](#):
>
> The csv export doesn’t include passwords, so you’d have to have users go through a password reset routine or assign passwords during the csv import and email them to your users.

Yes, that’s what I expected. So they’ll all have to get an email to reset their password. Looks like some plugins for WP that Import users can auto-send that message.

---

<div class="post-metadata">

**Author:** ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)\
**Post date:** [November 10, 2017, 6:50pm UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/11 "2017-11-10T18:50:39Z")

</div>

If you have a lot of users, and they all try the reset lost password routine in a short period, you could have email deliverability issues as ISPs will think you are spamming them and throttle the messages WP sends out with the password reset link. I made that mistake and did it this way, then had to monitor the Mailgun logs for problems.

You could assign a random password to each user, then use a mail service like Mailchimp to send each individual a customized email using merge tags to include their username and password.

---

<div class="post-metadata">

**Author:** ![dylanb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanb/32/139102_2.png) [@dylanb](https://meta.discourse.org/u/dylanb)\
**Post date:** [November 10, 2017, 6:53pm UTC](https://meta.discourse.org/t/what-is-the-best-sso-approach/73462/12 "2017-11-10T18:53:16Z")

</div>

Good tip.

It’s almost like what I really need is the ability to use WordPress as an OAuth provider more than a SSO provider. Then I can skip a lot of these headaches potentially even if they have to click ‘login with WordPress’.

Now that I’m thinking about it more… Would this scenario actually work better:

- Discourse as SSO Provider
- Users can still register for forum
- Accounts that have a login for both forum and WP will be synced by email and will auto login if logged into the forum.
- Can login to WP by their WP credentials or ‘login via Discourse link’

The only drawback I see here is that new WP users wouldn’t automatically have a Discourse account created. That seems to be the only con, but a pretty big one.
