【问题标题】:Can not get refresh token for google drive (google API v2)无法获取谷歌驱动器的刷新令牌(谷歌 API v2)
【发布时间】:2014-03-31 01:29:39
【问题描述】:

尝试为我的应用获取刷新令牌以访问谷歌驱动器。

我执行了指南中的所有步骤:

https://developers.google.com/drive/web/quickstart/quickstart-nodejs

转到网址

> https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file&respon
> se_type=code&client_id=...&redirect_uri=http%3A%2F%2Fl
> ocalhost&approval_prompt=force

将得到的代码放入getTocket,总是得到只包含access_token的响应,没有refresh_token

{ access_token: '...',
  token_type: 'Bearer',
  expires_in: 3600 }

可能是什么问题?

我已经使用客户端 (clientId) 访问 youtube API (v2) 并获得了刷新令牌。我尝试创建另一个 clientId 但仍然无法获取刷新令牌。

我尝试使用用于带有谷歌驱动器的 youtuve API 的刷新令牌,但它似乎不起作用。 =(

【问题讨论】:

标签: node.js google-api google-drive-api


【解决方案1】:

我在 URL 请求中添加了“&access_type=offline”,它在之后起作用了。

【讨论】:

    猜你喜欢
    • 2013-07-20
    • 2016-07-10
    • 1970-01-01
    • 1970-01-01
    • 2021-05-06
    • 1970-01-01
    • 2019-01-11
    • 2015-05-17
    • 2017-04-19
    相关资源
    最近更新 更多