# Wordpress SSO User Data Sync

**URL:** https://meta.discourse.org/t/wordpress-sso-user-data-sync/100415
**Category:** WordPress
**Created:** [October 25, 2018, 2:18am UTC](https://meta.discourse.org/t/wordpress-sso-user-data-sync/100415 "2018-10-25T02:18:58Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![agatehouse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agatehouse/32/123245_2.png) [@agatehouse](https://meta.discourse.org/u/agatehouse)
#### Post date: [October 25, 2018, 2:18am UTC](https://meta.discourse.org/t/wordpress-sso-user-data-sync/100415/1 "2018-10-25T02:18:58Z")

</div>

Hi everyone,

This is more a matter of me seeking confirmation than anything else. I’ve got a primary membership website set up via Wordpress using SSO as a provider to Discourse on a subdomain (only members who have signed up for an account on WP can access the forum). Everything is working perfectly when testing and we are preparing to open up the forum in the coming days to our users.

I noticed this morning in Discourse that the **Users** list is only about 1/3 of the total members we have in Wordpress. None of the listed users on Discourse have been **seen** (as it’s not yet made public) but they are still available for me to view as an Admin.

When testing this morning, I noticed that our Test accounts would only appear in the Discourse User list once that user had activated via the security email.

My question the is, how are some users listed in in Discourse already but others aren’t considering no one has been able to log in as yet?

I want to ensure that when we go out to the community saying that the forum is available, that they will be able to login via SSL without any issues - not shooting ourselves in the foot with people advising that they can’t log in.

Any help / thoughts / suggestions here would be greatly appreciated.

Thanks!

---

<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: [October 25, 2018, 4:11am UTC](https://meta.discourse.org/t/wordpress-sso-user-data-sync/100415/2 "2018-10-25T04:11:15Z")

</div>

> [@agatehouse](#):
>
> My question the is, how are some users listed in in Discourse already but others aren’t considering no one has been able to log in as yet?

Have you enabled the ‘Create or Sync Discourse Users on Login’ option? It’s found on the [WP DIscourse](https://github.com/discourse/wp-discourse) SSO Provider tab. If so, Discourse users will be created when they login to your WordPress site.

---

<div class="post-metadata">

### Author: ![agatehouse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agatehouse/32/123245_2.png) [@agatehouse](https://meta.discourse.org/u/agatehouse)
#### Post date: [October 25, 2018, 4:15am UTC](https://meta.discourse.org/t/wordpress-sso-user-data-sync/100415/3 "2018-10-25T04:15:48Z")

</div>

Hey Simon,

Yep that’s selected and it all suddenly clicked in my daft mind as soon as I read your reply. For older users who may stay signed in to their Wordpress account by default, would they need to sign out and sign back in again for this to register?

---

<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: [October 25, 2018, 4:20am UTC](https://meta.discourse.org/t/wordpress-sso-user-data-sync/100415/4 "2018-10-25T04:20:25Z")

</div>

> [@agatehouse](#):
>
> For older users who may stay signed in to their Wordpress account by default, would they need to sign out and sign back in again for this to register?

They would need to logout and log back in for the sync\_user function to fire. They won’t need to logout and log back in once you are displaying sso login links to the forum. If you are going to display Discourse comments on your website, underneath each post that is published to Discourse there will be an SSO login link. Clicking that link will create accounts for users who haven’t had accounts created already.

---

<div class="post-metadata">

### Author: ![agatehouse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agatehouse/32/123245_2.png) [@agatehouse](https://meta.discourse.org/u/agatehouse)
#### Post date: [October 25, 2018, 4:27am UTC](https://meta.discourse.org/t/wordpress-sso-user-data-sync/100415/5 "2018-10-25T04:27:41Z")

</div>

Awesome, thanks so much for that. In terms of displaying an SSO login link, would that just mean making the direct link on our website to the forum \_[https://domain.com/session/sso\_](https://domain.com/session/sso_) ?

---

<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: [October 25, 2018, 4:41am UTC](https://meta.discourse.org/t/wordpress-sso-user-data-sync/100415/6 "2018-10-25T04:41:16Z")

</div>

Underneath posts that are published to Discourse, the plugin will create an SSO login link for you. It will look something like this:

 ![47%20PM](https://global.discourse-cdn.com/meta/original/3X/7/2/72c4f90ee64e97444ff580b7d780c0244a28e60b.png)

You can style it however you like. The text that is used for the link can be set on the plugin’s Text Content options tab.

If you look at the value of the link’s `href` attribute, you can see how to create an SSO login link that you could use in other places on your forum.

```plaintext
<a href="http://forum.example.com/session/sso?return_path=http://forum.example.com/t/testing-pluralizations-in-the-topic-map/530">Simon's Test Forum</a>

```

Set the value of the `return_path` parameter to the URL on your forum that you want users to end up on when they click the link. To take users to your forum’s homepage, you can leave out the `return_path` parameter.

---

<div class="post-metadata">

### Author: ![agatehouse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agatehouse/32/123245_2.png) [@agatehouse](https://meta.discourse.org/u/agatehouse)
#### Post date: [October 25, 2018, 4:48am UTC](https://meta.discourse.org/t/wordpress-sso-user-data-sync/100415/7 "2018-10-25T04:48:55Z")

</div>

Legend, thanks so much for taking the time to help out with this!
