I’ve been using PHP to interact with the Patreon API for a while now, however my scripts appear to have stopped working as of yesterday(-ish).
Upon investigating, I noticed that a newer version of the project had been committed (going from version 1.0 to 2.0). However updating didn’t solve the issue.
I dug into it a bit and I’ve noticed that I’m no longer getting a token reply. I investigated into the curl calls being executed by OAuth.php, and the response consists of an HTML block which says:
"One more step
Please complete the security check to access api.patreon.com"
I’m not sure what to make of it, since I’d expect the API to return some sort of json block if there was a problem.
Could this be a hiccup with the updated API itself or am I simply missing something? I’m still learning my way through here, so it might just be me. The relevant section of code after returning from the Patreon Login page with the appropriate single-use code is effectively the same as the example on the documentation:
$client_id = 'x'; $client_secret = 'y'; $creator_id = 'z'; $redirect_uri = "a; //(All substituted by their appropriate values, of course) $oauth_client = new Patreon\OAuth($client_id, $client_secret); $tokens = $oauth_client->get_tokens($_GET['code'], $redirect_uri); $access_token = $tokens['access_token']; $refresh_token = $tokens['refresh_token'];
Both tokens return NULL, and following the get_tokens() function leads to the aforementioned HTML.