# WP Discourse SSO not working / looping back to wordpress

**URL:** https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357
**Category:** WordPress
**Created:** [19.Ноябрь.2017 10:32:30 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357 "2017-11-19T10:32:30Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Frankpanduh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frankpanduh/32/82581_2.png) [@Frankpanduh](https://meta.discourse.org/u/Frankpanduh)
#### Post date: [19.Ноябрь.2017 10:32:30 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/1 "2017-11-19T10:32:30Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [19.Ноябрь.2017 10:34:44 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/2 "2017-11-19T10:34:44Z")

</div>

What is Your SSO Provider Wordpress or Discourse?

---

<div class="post-metadata">

### Author: ![Frankpanduh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frankpanduh/32/82581_2.png) [@Frankpanduh](https://meta.discourse.org/u/Frankpanduh)
#### Post date: [19.Ноябрь.2017 10:46:10 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/3 "2017-11-19T10:46:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [19.Ноябрь.2017 10:48:49 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/4 "2017-11-19T10:48:49Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [19.Ноябрь.2017 10:53:10 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/5 "2017-11-19T10:53:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Frankpanduh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frankpanduh/32/82581_2.png) [@Frankpanduh](https://meta.discourse.org/u/Frankpanduh)
#### Post date: [19.Ноябрь.2017 11:03:20 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/6 "2017-11-19T11:03:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [19.Ноябрь.2017 11:12:21 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/7 "2017-11-19T11:12:21Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![Frankpanduh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frankpanduh/32/82581_2.png) [@Frankpanduh](https://meta.discourse.org/u/Frankpanduh)
#### Post date: [19.Ноябрь.2017 11:56:37 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/8 "2017-11-19T11:56:37Z")

</div>

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

=]

Thanks Bhanu!

---

<div class="post-metadata">

### Author: ![Frankpanduh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frankpanduh/32/82581_2.png) [@Frankpanduh](https://meta.discourse.org/u/Frankpanduh)
#### Post date: [19.Ноябрь.2017 12:13:28 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/9 "2017-11-19T12:13:28Z")

</div>

Update:

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

 ![20 AM](https://global.discourse-cdn.com/meta/original/3X/7/5/7587b3a89331b93cb356a8d8bc49a811fb7d29d0.png)

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [19.Ноябрь.2017 12:24:59 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/10 "2017-11-19T12:24:59Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [19.Ноябрь.2017 12:34:10 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/11 "2017-11-19T12:34:10Z")

</div>

@simon 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](https://wordpress.org/plugins/theme-my-login/) ??

---

<div class="post-metadata">

### Author: ![Frankpanduh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frankpanduh/32/82581_2.png) [@Frankpanduh](https://meta.discourse.org/u/Frankpanduh)
#### Post date: [19.Ноябрь.2017 12:35:48 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/12 "2017-11-19T12:35:48Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [19.Ноябрь.2017 12:38:30 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/13 "2017-11-19T12:38:30Z")

</div>

Divi theme is totally fine! … I’ve used it on wp install running [discourse SSO](https://meta.discourse.org/t/13045?silent=true) 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.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [19.Ноябрь.2017 12:40:44 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/14 "2017-11-19T12:40:44Z")

</div>

> [@Frankpanduh](#):
>
> We also use wordfence security

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](https://meta.discourse.org/t/13045?silent=true) without any issue.

---

<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: [19.Ноябрь.2017 14:51:29 UTC](https://meta.discourse.org/t/wp-discourse-sso-not-working-looping-back-to-wordpress/74357/15 "2017-11-19T14:51:29Z")

</div>

> [@Frankpanduh](#):
>
> We also use wordfence security
> 
> And this weird theming tool called divi.

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

> [@itsbhanusharma](#):
>
> do You have any recommendation on how to integrate wp-discourse to custom login plugins like theme my login ??

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