Creator Access Token expiring very quickly


#1

Hi there!

We’re having some troubles with Creator Access Tokens expiring very quickly and not being able to refresh them afterwards. Currently it seems like they’re expiring almost every day. The refresh token also seems to expire, which I don’t think should happen right? When I try to use the refresh token, I always get [error] => invalid_grant.

We’re using the PHP library, using the code pretty much as it is in one of the examples.

Any idea what might cause something like this?

  • Aran

#2

If you log in to your website using your creator account it will reset the Creator Access Token. You must not use your creator account for testing access to your site.


#3

Ah that explains a lot! That’s exactly what we were doing. Thank you. Is there any way to prevent this from happening? We’d like to test our own portal with our own account. Could we use the standard OAuth flow for requesting our patrons instead, bypassing the creator access token altogether?


#4

As far as I know there is no way to be able to use your creator account through OAuth without the Creator’s Access Token being reset — this caught me out too when developing my Patreon PHP library.

Access tokens obtained through the OAuth flow and the Creator’s Access Token are different, OAuth tokens do not grant campaign access.

What’s your use case for requiring your Patreon creator’s account be able to log in to your patron portal? The approach I’ve taken (and recommend in my libraries demo[1]) is to create a separate Patreon account which pledges to your campaign and use that for testing patron access through OAuth. That isn’t ideal, but it works.

[1] https://github.com/1f991/patreon-php-example/blob/master/README.md#accepting-logins

Ps if you’re using PHP 7.2 you may find my library more useful than the official Patreon PHP library as it includes more features: https://github.com/1f991/patreon-php


#5

Using our own account to login in to the Patreon portal is used for checking if the things for our patrons are actually all set-up correctly. Our own account is essentially treated as a patron as well. We could setup a second account but that would just be a bit of a hassle.