# Response code: 401

**URL:** <https://www.patreondevelopers.com/t/response-code-401/2845>\
**Category:** Wordpress Plugin\
**Created:** [March 6, 2020, 10:16am UTC](https://www.patreondevelopers.com/t/response-code-401/2845 "2020-03-06T10:16:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![BLUE\_BLACK](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/blue_black/32/1213_2.png) [@BLUE\_BLACK](https://www.patreondevelopers.com/u/BLUE_BLACK)\
**Post date:** [March 6, 2020, 10:16am UTC](https://www.patreondevelopers.com/t/response-code-401/2845/1 "2020-03-06T10:16:26Z")

</div>

Dear All ,  
Since updated Patreon plugin to Version 1.5.0 I’m getting following error

Response code: 401 Response :{“errors”:[{“code”:1,“code\_name”:“Unauthorized”,“detail”:“The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn’t understand how to supply the credentials required.”,“id”:“d17a6005-b80d-4911-89e7-8158faf1d0d4”,“status”:“401”,“title”:“Unauthorized”}]}

What I tried to solve  
\*\* Deleted API in Patreon and re-created and re-connect it (Nothing Changed)  
\*\* Deleted Plugin and it’s database and re-installed in my website (Nothing Changed)

\*\* It’s marked as V.2

Any other solution ideas please … Thanks in Advance

---

<div class="post-metadata">

**Author:** ![BLUE\_BLACK](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/blue_black/32/1213_2.png) [@BLUE\_BLACK](https://www.patreondevelopers.com/u/BLUE_BLACK)\
**Post date:** [March 6, 2020, 10:22am UTC](https://www.patreondevelopers.com/t/response-code-401/2845/2 "2020-03-06T10:22:21Z")

</div>

Here you can see some of errors

**0.24 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

**0.24 days ago**

Response code: 401 Response :{“errors”:[{“code”:1,“code\_name”:“Unauthorized”,“detail”:“The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn’t understand how to supply the credentials required.”,“id”:“d17a6005-b80d-4911-89e7-8158faf1d0d4”,“status”:“401”,“title”:“Unauthorized”}]}

**0.84 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

**0.84 days ago**

Response code: 401 Response :{“errors”:[{“code”:1,“code\_name”:“Unauthorized”,“detail”:“The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn’t understand how to supply the credentials required.”,“id”:“c2a84c96-69b5-4598-b595-fe03897051f7”,“status”:“401”,“title”:“Unauthorized”}]}

**0.84 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

**0.84 days ago**

Response code: 401 Response :{“errors”:[{“code”:1,“code\_name”:“Unauthorized”,“detail”:“The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn’t understand how to supply the credentials required.”,“id”:“9c4fdcdb-d350-4984-9e53-e0cb7399887a”,“status”:“401”,“title”:“Unauthorized”}]}

**0.84 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

**0.84 days ago**

Response code: 204 Response :

**0.84 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

**0.84 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

**0.84 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

**0.84 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

**0.84 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

**0.84 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

**0.84 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

**0.84 days ago**

Response code: 401 Response :{“error”: “invalid\_grant”}

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 6, 2020, 10:32am UTC](https://www.patreondevelopers.com/t/response-code-401/2845/3 "2020-03-06T10:32:23Z")

</div>

When was the first time you installed Patreon WordPress? This may be a leftover v1 installation conflicting with new v2 api.

---

<div class="post-metadata">

**Author:** ![BLUE\_BLACK](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/blue_black/32/1213_2.png) [@BLUE\_BLACK](https://www.patreondevelopers.com/u/BLUE_BLACK)\
**Post date:** [March 6, 2020, 10:53am UTC](https://www.patreondevelopers.com/t/response-code-401/2845/4 "2020-03-06T10:53:50Z")

</div>

I think it was October '19 my first installation …

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 6, 2020, 10:56am UTC](https://www.patreondevelopers.com/t/response-code-401/2845/5 "2020-03-06T10:56:51Z")

</div>

Lets use the forum instead so others can also read the issues and their solutions.

Where are you hosted?

---

<div class="post-metadata">

**Author:** ![BLUE\_BLACK](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/blue_black/32/1213_2.png) [@BLUE\_BLACK](https://www.patreondevelopers.com/u/BLUE_BLACK)\
**Post date:** [March 6, 2020, 10:59am UTC](https://www.patreondevelopers.com/t/response-code-401/2845/6 "2020-03-06T10:59:12Z")

</div>

Dreamhost VPS also I have Wordfence (only for your info)

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 6, 2020, 1:51pm UTC](https://www.patreondevelopers.com/t/response-code-401/2845/7 "2020-03-06T13:51:13Z")

</div>

Wordfence can interfere with a lot of things, including remote calls and remote responses. Can you try disabling it for a while to see if these errors will keep appearing in the log?

---

<div class="post-metadata">

**Author:** ![BLUE\_BLACK](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/blue_black/32/1213_2.png) [@BLUE\_BLACK](https://www.patreondevelopers.com/u/BLUE_BLACK)\
**Post date:** [March 6, 2020, 2:01pm UTC](https://www.patreondevelopers.com/t/response-code-401/2845/8 "2020-03-06T14:01:02Z")

</div>

Ok , I am disabling wordfence and checking situation… Will report to result as soon as possible…

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 6, 2020, 2:59pm UTC](https://www.patreondevelopers.com/t/response-code-401/2845/9 "2020-03-06T14:59:07Z")

</div>

Good luck.

Also note that if you have a mod like mod\_security with an Apache webserver at your host, that may interfere with a lot of stuff if its rules are configured aggressively. You may also want to contact your host about that.

---

<div class="post-metadata">

**Author:** ![BLUE\_BLACK](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/blue_black/32/1213_2.png) [@BLUE\_BLACK](https://www.patreondevelopers.com/u/BLUE_BLACK)\
**Post date:** [March 6, 2020, 7:03pm UTC](https://www.patreondevelopers.com/t/response-code-401/2845/10 "2020-03-06T19:03:21Z")

</div>

Ok, After disabling WordFence everything is looking fine… Thanks

---

<div class="post-metadata">

**Author:** ![ESL\_Brains](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/esl_brains/32/941_2.png) [@ESL\_Brains](https://www.patreondevelopers.com/u/ESL_Brains)\
**Post date:** [March 7, 2020, 11:57am UTC](https://www.patreondevelopers.com/t/response-code-401/2845/11 "2020-03-07T11:57:01Z")

</div>

@codebard I’m seeing something similar on my site, i.e. my last 50 errors are just:

`Response code: 401 Response :{"error": "invalid_grant"}`

All of them happening 0 days ago, so looks like a constant issue. I haven’t been updating any plugins recently so currently I’m running PW 1.4.8 and PPP 1.4.6 on WP 5.3.2.

Does it simply mean that my Patrons are forgetting their passwords and inputting wrong ones? Or it may mean something bigger?

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 8, 2020, 10:53am UTC](https://www.patreondevelopers.com/t/response-code-401/2845/12 "2020-03-08T10:53:02Z")

</div>

Can you try Disconnecting your site and then reconnecting it through the buttons in plugin settings?

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 9, 2020, 11:14am UTC](https://www.patreondevelopers.com/t/response-code-401/2845/13 "2020-03-09T11:14:20Z")

</div>

Also - do you also have Wordfence installed?

---

<div class="post-metadata">

**Author:** ![ESL\_Brains](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/esl_brains/32/941_2.png) [@ESL\_Brains](https://www.patreondevelopers.com/u/ESL_Brains)\
**Post date:** [March 21, 2020, 10:04am UTC](https://www.patreondevelopers.com/t/response-code-401/2845/14 "2020-03-21T10:04:15Z")

</div>

Nope, I don’t use Wordfence. I tried using that “Disconnect site” button on my staging environment but got this error:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/patreondevelopers/original/2X/9/9eec0db0421fa3a12e61b300a5443e38db33d45d.png)

BTW the “try again” link directs to [http://test.codebard.com/wp-admin/admin.php?page=patreon-plugin&patreon\_wordpress\_action=disconnect\_site\_from\_patreon](http://test.codebard.com/wp-admin/admin.php?page=patreon-plugin&patreon_wordpress_action=disconnect_site_from_patreon)

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 23, 2020, 5:00pm UTC](https://www.patreondevelopers.com/t/response-code-401/2845/15 "2020-03-23T17:00:37Z")

</div>

Which version of PW do you have as of this moment?

---

<div class="post-metadata">

**Author:** ![ESL\_Brains](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/esl_brains/32/941_2.png) [@ESL\_Brains](https://www.patreondevelopers.com/u/ESL_Brains)\
**Post date:** [March 30, 2020, 2:05pm UTC](https://www.patreondevelopers.com/t/response-code-401/2845/16 "2020-03-30T14:05:47Z")

</div>

PW is 1.5.2, PPP is 1.4.6.

Before I couldn’t see any consequences of that, but now I’m getting a few Patrons saying that they can’t access content when they’re logged in. So I reckon there is a chance it’s connected.

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [March 30, 2020, 7:58pm UTC](https://www.patreondevelopers.com/t/response-code-401/2845/17 "2020-03-30T19:58:41Z")

</div>

Now the thing is, the faulty redirect to [test.codebard.com](http://test.codebard.com) was fixed long before 1.5.2. It is not present in PPP either. But your site has that bug still for some reason. Despite being 1.5.2.

This raises the suspicion that your site may still be keeping an old version of the code in part due to something like opcode caching.

Please try to confirm whether you have an opcode caching plugin in your site, or whether your host has opcode caching. In either case cleaning entire opcode cache and retrying would provide pointers for this. Actually, likely fix it outright.

---

<div class="post-metadata">

**Author:** ![ESL\_Brains](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/esl_brains/32/941_2.png) [@ESL\_Brains](https://www.patreondevelopers.com/u/ESL_Brains)\
**Post date:** [April 2, 2020, 7:02pm UTC](https://www.patreondevelopers.com/t/response-code-401/2845/18 "2020-04-02T19:02:02Z")

</div>

**Staging environment:**  
So, I turned off opcache via my host settings. I also used Autoptimize plugin so I cleared the cache there as well just in case. That didn’t help a lot. I still get the same ‘Sorry, couldn’t disconnect your site’ screen but the redirect on that screen is correct now (i.e. not to [codebard.com](http://codebard.com)).

I’ve updated the plugin to the newest version 1.5.3 but still I can’t disconnect with the button. My Patreon App uses API v1. The only difference I see is that instead of that ‘invalid grant’ error I get this one:

`Response code: 401 Response :{"errors":[{"code":1,"code_name":"Unauthorized","detail":"The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.","id":"cffe665d-2962-4124-9b60-156865065dcc","status":"401","title":"Unauthorized"}]}`

On my **Prod environment** I also turned of opcache, cleared Autoptimize cache, tried disconnecting site and I get the same results as on staging (incl. the try again correctly linking to my site not codebard). Got my plugin updated, and still no difference. However, the errors I get on Prod are basically a wall of these:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/patreondevelopers/original/2X/5/5a59f7a33053f1e9fbf8effaec8f092cf7ca24c4.png)

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [April 2, 2020, 7:35pm UTC](https://www.patreondevelopers.com/t/response-code-401/2845/19 "2020-04-02T19:35:00Z")

</div>

> incl. the try again correctly linking to my site not codebard

Do you have still that link to ‘[test.codebard.com](http://test.codebard.com)’ in the error/info page?

---

<div class="post-metadata">

**Author:** ![ESL\_Brains](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/esl_brains/32/941_2.png) [@ESL\_Brains](https://www.patreondevelopers.com/u/ESL_Brains)\
**Post date:** [April 2, 2020, 7:59pm UTC](https://www.patreondevelopers.com/t/response-code-401/2845/20 "2020-04-02T19:59:05Z")

</div>

Nope, now it links to my site

[Next page](https://www.patreondevelopers.com/t/response-code-401/2845.md?page=2)
