SSO Settings Help

AI-generated summary

In a discussion titled ‘SSO Settings Help’ under the WordPress category, charliel seeks assistance configuring Single Sign-On (SSO) between WordPress and Discourse. Their issue: new users registering via WordPress after clicking ‘login’ on Discourse are redirected to the WordPress homepage instead of the forum. They suspect the domain mismatch (Discourse hosted on a subdomain) and ask whether both ‘enable sso’ and ‘enable sso provider’ should be enabled. simon clarifies that ‘enable sso’ is correct for using WordPress as the SSO provider, while ‘enable sso provider’ is for using Discourse as the provider — only the former should be enabled. Simon also suggests the redirect may stem from another WordPress plugin interfering. charliel adds that the redirect_to parameter is lost after users navigate to the registration page, which may be the root cause. simon acknowledges the misunderstanding and confirms that this behavior is standard — new users registering via WordPress are redirected to the homepage, as Discourse doesn’t control the post-registration flow. He offers to explore a workaround. charliel confirms many users register directly through the forum and welcomes any solution to improve the user experience.

We run a WordPress site and want to use Discourse as our forum, to replace bbPress.

Our current issue is that if a new user (not registered on WP) is on Discourse, clicks login then registers through WP, he ends up on our homepage, not the forum page. Now I’m wondering if this is because right now our Discourse forum is on oursitename.ourhostingsite.net so the domains are different.

Then I’m looking in the settings and wondering if

enable sso provider

Implement Discourse SSO provider protocol at the /session/sso_provider endpoint, requires sso_secret to be set

Should be ticked? Currently we have ticked enable sso and filled in the sso url and secret.

So basically, what’s the difference between enable sso and enable sso provider? Should both be ticked? Why might new users not be re-directed to the forum after signup?

Thanks.

I thing you have it setup correctly. The enable_sso setting on Discourse is the one you need to have checked. It’s for using WordPress as the SSO provider for Discourse. The Discourse enable_sso_provider setting is for using Discourse as the SSO provider for another site.

Your settings on Discourse should look like this - with a better sso_secret:

Usually when this happens it’s because there is another plugin on your site that is performing a redirect after login - redirecting users to your homepage. Do you have any plugins that could be doing this?

Might it because once clicking login, users are getting taken to www.oursite.com/custom-login-page, where I can see the redirect_to in the URL, but then if they’re new they have to click register so then they get taken to www.oursite.com/custom-login-page/?action=register, which doesn’t have the redirect_to in the URL anymore?

PS Not sure what’s going on with the formatting but you need to hover over the links I pasted to see the full paths.

Sorry, I didn’t read your question correctly. Yes, that’s the way it works when a user first registers. Ideally, users would register on WordPress before they tried to login to Discourse. I’ll see if I can come up with a workaround for this.

I see. Yes, it’s because a significant number of our forum users don’t register through WP first. They come straight to the forum. If you could find a workaround that would be great.