Google plus for android bad access token

馋奶兔 提交于 2019-12-11 10:35:14

问题


I been following Getting started and sign in to get access_token of user.

I do get an access token but when using it i am getting this error:

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

When I am going to apis-explorer and using they token it works just fine. Any ideas what am I missing?

This is then URL I am trying.

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


回答1:


These tokens have a 1 hour expiration period.




回答2:


Ping the server with some query every time you start the app and before starting your functions,this would refresh the token.



来源:https://stackoverflow.com/questions/14664065/google-plus-for-android-bad-access-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!