Hey fellas, I’m a relative newbie to working with PHP and HTTP so you’ll have to forgive me if I’ve missed something huge here - I’m working on a site that plans to integrate some per-tier functionality, so I need to be able to resolve a Patreon login, check the user’s tier and get them logged in a database, etc.
The login itself is working fine, I’m getting to the Patreon authorization page and it’s sending me back to my redirect URI after my POST with my Access Token and all. However, when I try to use that in the way I think the documentation is suggesting after looking over OAuth (it seems a little bit ambiguous at points):
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.patreon.com/api/oauth2/v2/identity'); $headers = ["Authorization: Bearer " . $_SESSION["access_token"]]; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $apiResponseMemberData = curl_exec($ch);
It’s handing me back a 401 authorization error, suggesting I supplied bad credentials or that my browser didn’t know how to supply them. I thought a possible answer might be in setting
as another custom header to tell it how to supply the content, but doing so doesn’t seem to be doing the trick either.
Pardon me if there’s a super simple fix on this one, I was shopping around for a fix for a while but unfortunately the vagueness of the feedback itself is making it hard to know where to go looking for a fix. Thanks a bunch in advance for the help.