【发布时间】:2019-10-02 09:07:54
【问题描述】:
我正在开发 Google Drive Rest Api,以便在使用 google 登录后将文件上传和下载到 google drive。
我能够获得每 60 分钟后过期的访问令牌我想通过使用以前的令牌登录来获得刷新访问令牌我该如何实现这一点。
提前致谢
【问题讨论】:
标签: android google-oauth drive
我正在开发 Google Drive Rest Api,以便在使用 google 登录后将文件上传和下载到 google drive。
我能够获得每 60 分钟后过期的访问令牌我想通过使用以前的令牌登录来获得刷新访问令牌我该如何实现这一点。
提前致谢
【问题讨论】:
标签: android google-oauth drive
使用用户登录时提供的刷新令牌并使用此 url 发送 POST 请求
https://oauth2.googleapis.com/token?client_id=your_client_id&client_secret=your_client_secret&refresh_token=refresh_token&grant_type=refresh_token
有关更多信息,请查看文档: https://developers.google.com/identity/protocols/OAuth2InstalledApp#handlingresponse
【讨论】: