【问题标题】:Google plus for android bad access tokenGoogle plus for android 错误访问令牌
【发布时间】:2013-01-17 19:32:19
【问题描述】:

我一直关注Getting started和sign in获取用户的access_token。

我确实获得了访问令牌,但在使用它时出现此错误:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "authError",
    "message": "Invalid Credentials",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Invalid Credentials"
 }
}

当我要去apis-explorer 并使用他们的令牌时,它工作得很好。 任何想法我错过了什么?

这就是我正在尝试的 URL。

https://www.googleapis.com/plus/v1/people/me?key={my_api_key}&access_token=my_access_token

【问题讨论】:

  • 您应该发布您的代码,以便我们帮助诊断问题。

标签: android api google-plus access-token


【解决方案1】:

这些令牌有 1 小时的有效期。

【讨论】:

    【解决方案2】:

    每次启动应用程序和启动函数之前,使用一些查询 Ping 服务器,这将刷新令牌。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-08
      • 2013-11-02
      • 2014-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-17
      相关资源
      最近更新 更多