Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pinterest's official OAuth2 flow seemingly returns an invalid access token

I followed the Pinterest's instructions to authenticate a user and after completing step 2 I am holding an access token in my hands. However, when I use this access token to make an API call I get the following response:

{"status": "failure", "code": 3, "host": "coreapp-devplatform-devapi-179", "generated_at": "Sat, 26 Sep 2015 15:11:35 +0000", "message": "Authorization failed.", "data": null}

When I use the Token Generator the API calls succeed. In both cases I tried:

https://api.pinterest.com/v1/me/?access_token=<YOUR-ACCESS-TOKEN>

Any ideas?


Update: Zack Argyle from Pinterest just tweeted they are working on a fix on their end. https://twitter.com/zackargyle/status/648547619229138944

like image 379
analog-nico Avatar asked Feb 08 '23 23:02

analog-nico


1 Answers

For those of you who are facing the issue when requesting for access_token in the post request include client_secret too in the 2nd step

https://developers.pinterest.com/docs/api/authentication/

i.e the post params while requesting this end point https://api.pinterest.com/v1/oauth/token will be:

grant_type Must be authorization_code

client_id This is your app ID.

client_secret This is your app Secret

code The authorization code passed to your redirect URI

like image 128
azero0 Avatar answered May 14 '23 13:05

azero0