Google plus for android bad access token

2019-08-03 02:37发布

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

2条回答
乱世女痞
2楼-- · 2019-08-03 03:13

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

查看更多
Lonely孤独者°
3楼-- · 2019-08-03 03:25

These tokens have a 1 hour expiration period.

查看更多
登录 后发表回答