无法获取谷歌驱动器的刷新令牌(谷歌API v2)

试图让我的应用程序访问谷歌驱动器的刷新令牌。

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

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

去URL

> 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),并且我得到了更新的令牌。 我试图创build另一个clientId,但仍然无法获得刷新令牌。

我试图使用刷新令牌,我用你的谷歌驱动器的API,但它似乎不工作。 =(

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