Wordpress SSO User Data Sync

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!

2 Likes

Have you enabled the ‘Create or Sync Discourse Users on Login’ option? It’s found on the WP DIscourse SSO Provider tab. If so, Discourse users will be created when they login to your WordPress site.

2 Likes

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?

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.

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 ?

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

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.

<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.

2 Likes

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

2 Likes