【问题标题】:Google + access token insufficient permissionGoogle+访问令牌权限不足
【发布时间】:2015-01-09 04:05:42
【问题描述】:

使用 OAuth 代码,我可以为 google+ API 生成访问令牌。

oauthpalyground 中使用此访问令牌,我得到 JSON 响应。

当我将此 URL 粘贴到浏览器中时,会收到一条错误消息。

 https://www.googleapis.com/plus/v1/activities?query=%22great%22&access_token=xxxxxxxxxxx 

错误信息

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "insufficientPermissions",
    "message": "Insufficient Permission"
   }
  ],
  "code": 403,
  "message": "Insufficient Permission"
 }
}

谁能给我解释一下为什么?

【问题讨论】:

  • 尝试将 &access_token 更改为 &oauth_token=
  • access_token 是正确的查询参数。
  • 您在进行身份验证时要求的范围是什么?

标签: google-plus google-oauth oauth2-playground


【解决方案1】:

您不能直接从将 access_token 作为查询字符串发送的浏览器进行查询。您必须以这种方式在标头中发送 access_ 令牌:

Authorization: Bearer <access_token>

用 Fiddler 或类似的软件试试吧。

【讨论】:

    猜你喜欢
    • 2019-12-03
    • 2013-08-14
    • 2018-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-19
    • 2012-10-16
    • 2019-11-15
    相关资源
    最近更新 更多