WP Discourse SSO not working / looping back to wordpress


(Frank Panduh) #1

I’m struggling to get the SSO setup with Wordpress.

after setting up on both the discourse and Wordpress according to setup tutorials.

my attempt to login to the discourse post setup:

discourse login < Wordpress login page < sign in < redirected back Wordpress

but never redirects back to discourse or logs in to discourse at all.

I been trying to figure out this loop any insight as to whats going on?

Wordpress Setup:
NGINX | PHP-FPM | PHP-CURL | MARIADB (https)
(possible causes that i can’t entirely figure out: using THEME-MY-LOGIN / DIVI Builder )

Discourse Setup:
Digital Ocean One-Click. (HTTPS)


(Bhanu Sharma) #2

What is Your SSO Provider Wordpress or Discourse?


(Frank Panduh) #3

Was trying to set it up as Wordpress being the provider.


(Bhanu Sharma) #4

So Can You Please Cross check the Following are Correctly done:

#1 Your SSO Secret is same across Discourse and Wordpress
#2 Wordpress is Configured as SSO Provider not Client (Only Fields under the SSO Provider sub-tab are Populated)
#3 On Discourse, You’ve Enabled the SSO (and Not Provider) Along with a SSO URL (Link to Your wordpress Install) ?

I’m using exact same setup and mine works fine.


(Bhanu Sharma) #5

if You have somehow enabled the “sso allows all return paths” option, Disable it and try again

Also, Try disabling the Theme my Login Plugin as it may be redirecting your users back to the wordpress homepage Ignoring the Discourse Callback


(Frank Panduh) #6

Yeah it’s still taking me just to my Wordpress with your recommended settings. Even after turning off theme my login.


(Bhanu Sharma) #7

That’s really Strange!

Can You DM me some Information? I’d have to investigate it because the same configuration I suggested above works absolutely fine on my website!


(Frank Panduh) #8

DM’d you some stuff when you get the chance if you can!

=]

Thanks Bhanu!


(Frank Panduh) #9

Update:

seems like i can log in now but now i get this post login:

20 AM


(Bhanu Sharma) #10

I’m almost certain this is either due to the custom login/register plugin messing up with permissions or due to Wordpress Getting confused among your user accounts between the transition (Different username or email) so this needs to be investigated further.

I’m on the other hand totally able to create and register users! …

I hope You have the re-enabled the “sso allows all return paths” which probably will fix this issue.


(Bhanu Sharma) #11

@Simon_Cossar I’m unable to recreate his issue and There is nothing that can be blamed! … settings seem fine and the only thing I can suggest him is to revert back to wordpress default login/registration system instead of a plugin.

do You have any recommendation on how to integrate wp-discourse to custom login plugins like theme my login ??


(Frank Panduh) #12

Not the slightest tbh.

We also use wordfence security

And this weird theming tool called divi. So I’m not sure they would also be a conflict.


(Bhanu Sharma) #13

Divi theme is totally fine! … I’ve used it on wp install running discourse SSO and it worked absolutely fine.

the problem is rather something removing the discourse hook from the URL and rather redirecting the default register page to something else.!

I was able to recreate your issue by installing the theme my login plugin so I’d suggest You first try disabling it and then ensuring that the flow works fine! I hope simon can provide better help at resolving the compatibility between two plugins.


(Bhanu Sharma) #14

Not a 100% sure about this one but with some Frankenstein tweaks I was able to use the Hide my WP plugin along with discourse sso without any issue.


(Simon Cossar) #15

Neither of those plugins should be a problem, but are you using this?

If so, from reading that plugin’s description, it looks like it could be cause problems with SSO login: