Response code: 401

That shows its updated at least - thats a major improvement.

Please try this procedure:

  • In connection settings tab, delete every field and save settings.

  • Make sure there is no registered app in register clients page at Patreon for that particular site

  • Make sure you are logged into the relevant creator account at Patreon

  • Try using the Connect button in Patreon Settings page.

If this fails, there’s something decisively amiss with your site’s connection.

I’m having the same problems with WP on my site. My patrons can’t access the Patreon only content. Various error messages. I have the most up to date version of the plugin and using V2. I have tried disconnecting using the settings in the plugin, only to get the same unable to disconnect message. Finally able to manually disonnect it from Patreon. Deleted the plugin. Started over, and still getting the same problems.

Ok, I followed your procedure and got reconnected. I tested that on my staging environment. After that, I went through the process to test if everything is okay and I potentially found what’s throwing those “invalid_grant” errors.

Bear with me as I explain how I used Patreon plugin and maybe you’ll be able to help me fix it.

I created a sign up page. On that page I have my Patreon Tiers explained and 3 sign up buttons:


I wanted these buttons to work just as the Become a Patron buttons that put users directly into the Patreon checkout process. But I additionally wanted users to be redirected to a Thank You Page (actually to 3 different thank you pages so I could track the conversion). I couldn’t figure out how to do the redirection - there is only this in the Become a Patreon link:
redirect_uri=https%3A%2F%2Feslbrains.com%2Fpatreon-authorization%2F&state=
so no exact parameter (at least for me) to point where a user should be redirected.

So I came up with an (ugly) hack :). I generated a “Become a Patron” button on those Thank You Pages, copied the links and put those links in the buttons on my sign up page. Obviously, I removed those Become a Patron buttons from my Thank You Pages. When I tested it on my staging everything worked perfectly, i.e I could use the buttons on my sign up page, go through the checkout and then get redirected to a thank you page on my site and be automatically logged in.

Now, when I was testing the sign up process after reconnecting my staging environment according to your procedure, I found out that the process works up to the point of logging into my website, i.e. I could use the button on the sign up page, create account and get redirected to a Thank You page but I wasn’t automatically logged in (even though I click “allow” on the screen below).
image

Instead when I got redirected to the Thank You Page I get this in URL:
http://test.eslbrains.com/thank-you5/?patreon_message=patreon_cant_login_api_error&patreon_error=invalid_grant

This only happens when using the buttons on my sign up page. Everything works okay when I use the Become a Patron button on any post with locked content:

So the above happens now on my staging environment. Just to test I created 2 accounts to be sure. I figured that’s why I have errors on my production environment but when I tested the process on my production env today, it worked perfectly. I tested it only with one of the buttons because otherwise I’d have to create 2 more accounts.

Side note: It’s ridiculous and frustrating that we can’t have some tests users as creators and instead I need to pledge and create dummy users tied to my credit card account any time I want to test something

Now, my question is why I’m getting this “invalid_grant” errors on production. I hope my explanations helped clarify the case. I can only suspect that one of those 3 sign up buttons is throwing this error (I just tested one of them on production). I can test that if necessary but I don’t get new Patrons every 5 mins and my logs look like that:

All in all, I’d like to know why I see those errors and how my users are affected by it :slight_smile: Oz, help :slight_smile:

What is the specific error or issue that you are getting when connecting your site?

Users must not be immediately redirected to thank you page when they return - they must be redirected to patreon-authorization page.

The final redirect can be put into final_redirect_uri parameter in state variable array and then sent to Patreon after being json_encode -> base64_encode -> urlencode in that order.

Reviving this thread as I’ve been getting this problem as well all of a sudden.

WP 5.8.2 with PHP 7.4.26
Patreon WordPress 1.7.9 with API v2

The errors on the health check page:

**0.01 days ago**

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

**0.01 days ago**

fetch_user - API v2 Class - UUID 54cdca51-7d77-4aa4-9877-5b940b8d7182 - 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":"54cdca51-7d77-4aa4-9877-5b940b8d7182","status":"401","title":"Unauthorized"}]}

**0.01 days ago**

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

**0.01 days ago**

fetch_creator_info - API v2 Class - UUID 1be35fa5-c7e5-4305-857c-9b3b928475cf - 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":"1be35fa5-c7e5-4305-857c-9b3b928475cf","status":"401","title":"Unauthorized"}]}

**0.01 days ago**

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

**0.01 days ago**

fetch_creator_info - API v2 Class - UUID 40fa2374-848e-4f70-a736-6c24a8d6a8cb - 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":"40fa2374-848e-4f70-a736-6c24a8d6a8cb","status":"401","title":"Unauthorized"}]}

**0.01 days ago**

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

**0.01 days ago**

fetch_creator_info - API v2 Class - UUID 0931818f-1546-4aaa-b124-5e229fef3890 - 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":"0931818f-1546-4aaa-b124-5e229fef3890","status":"401","title":"Unauthorized"}]}

Same deal as the OP, deleted the API, re-created, reconnected, API was upgraded from V1 to V2 but still nothing. Deleted the plugin entirely and also nothing. Did a rollback to previous versions and nothing. No new plugins have been installed during the time this problem started occurring. Cloudflare is used on this site but it also has been since its creation, so I don’t think caching is the problem either.

Note that the plugin has been working near-flawlessly for the last two years or so, so this is the biggest hiccup thus far. Patrons are unable to log in to view gated content at all, and I’ve exhausted almost all options at this point…

Does this still continue to happen as of this moment?

Yes, similar errors still occurring as of 0.5 days ago.

Can you try force-refreshing your connection to patreon.com?