# Discourse SSO with Wordpress as Provider displays error invalid request

**URL:** https://meta.discourse.org/t/discourse-sso-with-wordpress-as-provider-displays-error-invalid-request/172095
**Category:** WordPress
**Created:** [December 3, 2020, 10:31am UTC](https://meta.discourse.org/t/discourse-sso-with-wordpress-as-provider-displays-error-invalid-request/172095 "2020-12-03T10:31:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Lagger\_Gandalf](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lagger_gandalf/32/128962_2.png) [@Lagger\_Gandalf](https://meta.discourse.org/u/Lagger_Gandalf)
#### Post date: [December 3, 2020, 10:31am UTC](https://meta.discourse.org/t/discourse-sso-with-wordpress-as-provider-displays-error-invalid-request/172095/1 "2020-12-03T10:31:12Z")

</div>

Im currently facing a strange Issue on my Wordpress and Discourse Installation.  
I’ve setup Wordpress as SSO Provider for Discourse since 2018.

So far everything worked fine. Since recent I get the Error “Invalid Request” , when a User is accessing the Forum on the Sub Url “[discourse.sub.domain.com](http://discourse.sub.domain.com)” directly, gets redirected to the Wordpress Login Page “[sub.domain.com/login](http://sub.domain.com/login)” and logs in:

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/9/09be325c5be12414ad15c8671d1ead3778492fe7.png)

When the User access the Forum URL again “[discourse.sub.domain.com](http://discourse.sub.domain.com)” he’s logged in and everything works fine.

I’ve renewed the SSO Secrets and they seem to work fine, the User Login works. I also did renew the API Key and that one also works:

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/b/2b4772699c2e1a4992b0ee7041a083c185e6a6ff.png)  
 ![image](https://global.discourse-cdn.com/meta/original/3X/d/9/d9067a817bbd08b41f9caddd45c84673404bb88d.png)

I’ve activated the Debug on Wordpress and Discourse, but no error gets logged inside it:

 ![Screenshot 2020-12-03 112816](https://global.discourse-cdn.com/meta/original/3X/3/b/3bb13aafbf2e72b676240002ef7737d819af9bc7.jpeg)  
Does the Wordpress SSO Plugin have any other debugg login option to check?

---

<div class="post-metadata">

### Author: ![Lagger\_Gandalf](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lagger_gandalf/32/128962_2.png) [@Lagger\_Gandalf](https://meta.discourse.org/u/Lagger_Gandalf)
#### Post date: [December 3, 2020, 10:46am UTC](https://meta.discourse.org/t/discourse-sso-with-wordpress-as-provider-displays-error-invalid-request/172095/2 "2020-12-03T10:46:25Z")

</div>

When a new User is created, the SSO Sync works flawless and the User doesnt get the Error displayed “Invalid Request”.

When I try a older User, I get on the first login attempt the Error “Invalid Request”.

Also the Discourse Log shows, that the Login was succesfull without error:

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/f/9f24084dc885f1b9fbde5ebf1357b401ee3a2841.png)

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [December 4, 2020, 2:24am UTC](https://meta.discourse.org/t/discourse-sso-with-wordpress-as-provider-displays-error-invalid-request/172095/3 "2020-12-04T02:24:25Z")

</div>

Thanks for your report, I suspect if there’s an issue it will be related to the multi-level subdomain usage. I’ll see if I can reproduce it and get back to you soon.
