带有googleapis node.js的“ unauthorized_client”(刷新访问令牌)(

时间:2019-03-18 17:19:08

标签: ios node.js oauth google-api google-oauth

我目前有一个客户端iOS应用程序,该应用程序使用Google SDK进行“用Google登录”(https://developers.google.com/identity/sign-in/ios/),该应用程序将访问令牌保存在后端。然后,当我尝试通过googleapi为node.js(https://github.com/googleapis/google-api-nodejs-client)刷新令牌时

oAuth2Client.setCredentials({refresh_token:STORED_REFRESH_TOKEN,access_token:STORED_ACCESS_TOKEN});
oauth2Client.refreshAccessToken((err, tokens) => {
  // your access_token is now refreshed and stored in oauth2Client
  // store these new tokens in a safe place (e.g. database)
})

我得到了错误

  

错误:unauthorized_client

0 个答案:

没有答案