User Jason_Lorje sought help configuring Single Sign-On (SSO) between a WordPress multisite network and a hosted Discourse instance. Initially using the WP Multisite SSO plugin, they encountered a redirect loop and a ‘BAD CSRF’ error that locked them out of their admin account. Community member fefrei suggested using a private browser tab to access /users/admin-login to regain access, while noting the SSO URL configuration appeared incorrect. After successfully logging in, Jason_Lorje decided to pause reactivating SSO pending official guidance.
Later, AdamCapriola provided a detailed integration guide, advising against the ‘enable sso provider’ checkbox on the Discourse side and suggesting the WP Multisite SSO plugin might be the cause of conflicts. Jason_Lorje eventually resolved the issue by switching to the WP Multisite User Management plugin instead. The successful configuration involved enabling ‘Enable SSO to Discourse’ on the WordPress side and, crucially, enabling ‘Enable SSO Provider’ on the Discourse side with the correct URL path (/session/sso_provider), along with overriding email and username settings.
I have now activated sso via WP plugin and in discourse. When I try to link to my forum I get: The webpage at http://pods.myenterpride.com/session/sso has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
I can also not get into my admin account via /users/admin-login I am getting [‘BAD CSRF’]
To get back into your site, try to open a private tab to use /users/admin-login.
If this doesn’t work, ssh into your server and use these instructions to manually disable SSO.
I think that your SSO url is wrong. I was redirected to http://pods.myenterpride.com?sso=<token>&sig=<signature>, which is the domain of your Discourse installation. While I have no idea about the WP side of things, this needs to point somewhere where WP handles it.
`
I’m still intrigued by the BAD CSRF. I literally didn’t do anything than opening a new private tab in chrome, put in your E-Mail address, submitted the form, and got a confirmation…
Your situation sounds very complex. You may need to wait until business weekdays for us to help. We generally do not work weekends unless something is on fire.
Thank you all for your input, I have solved the problem For those that may follow this thread, and are trying to connect discourse to a WP multisite here is what you shouldn’t and should do.
Don’t use WP Multisite SSO plugin, it breaks everything. Use WP Multisite User Management instead. @AdamCapriola Sorry mate, I couldn’t get your plugin to work, probably my lack of coding experience, though.
What worked: On the WP side: Use the WP Discourse plugin, Check the ‘Enable SSO to Discourse’, check that all user ID’s are the same across the network. On Discourse side: Enable SSO, Enable SSO Provider, and set URL to yoursite.com (for some reason I overlooked this ), override e-mail, override username and set not approved url. Clear all caches and test incognito.