问题描述
我按照 Pinterest 的说明验证用户,并在完成第 2 步后我手里拿着一个访问令牌.但是,当我使用此访问令牌进行 API 调用时,我得到以下响应:
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}
当我使用 令牌生成器 时,API 调用成功.在这两种情况下,我都尝试过:
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>
有什么想法吗?
更新: Pinterest 的 Zack Argyle 刚刚在推特上发文称,他们正在努力解决问题.https://twitter.com/zackargyle/status/648547619229138944
Update: Zack Argyle from Pinterest just tweeted they are working on a fix on their end. https://twitter.com/zackargyle/status/648547619229138944
推荐答案
来自 Pinterest 的 Zack Argyle 刚刚在推特上说他们部署了一个修复程序来解决我描述的问题:https://twitter.com/zackargyle/status/648602180002312192
Zack Argyle from Pinterest just tweeted that they deployed a fix which solves the problem I described:https://twitter.com/zackargyle/status/648602180002312192
总结:
- 按照 https://developers.pinterest.com/docs/api/authentication 上的说明进行操作/
- 不是在第一个请求中而是在第二个请求中传递 client_secret
- 在第一个请求中使用 response_type=code
这篇关于Pinterest 的官方 OAuth2 流程似乎返回了无效的访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!