Google云端硬盘API的刷新令牌何时过期? [英] When does Refresh Token expires for Google Drive API?

查看:102
本文介绍了Google云端硬盘API的刷新令牌何时过期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用python使用Google Drive API来下载文件.我看到它第一次需要身份验证,并生成一个 token.pickle 文件.从下一次开始,我们可以使用此令牌文件进行API调用.

I just Started using Google Drive API using python to download File. I'm seeing it requires authentication for the first time and generates a token.pickle file. From next time onwards we can use this token file for API call.

注意::文件token.pickle存储用户的访问和刷新令牌.

Note : The file token.pickle stores the user's access and refresh tokens.

我需要知道的是此令牌文件何时到期?如果到期,那么如何延长其有效性?

What I needed to know is when this token file will expire ? If it expires then how to extend it's validity ?

我已经浏览了许多Google文档,但找不到与此相关的任何明确信息.

I've gone through many google documentations but couldn't find anything clear regarding this.

如果有人可以向我建议任何信息,那将是非常受欢迎的.

If anyone can suggest me any info on this, that will be most welcomed.

推荐答案

刷新令牌不应过期,但可以过期.

Refresh tokens shouldn't expire but they can.

  1. 如果用户通过其Google帐户删除了您的访问权限,则刷新令牌将过期
  2. 如果刷新令牌在六个月内未使用,它将过期.
  3. 当用户对您的应用程序进行身份验证时,您将获得访问令牌和刷新令牌,如果他们再次对您的应用程序进行身份验证,则将获得另一个访问令牌和刷新令牌.您最多可以为一个用户帐户使用五十个刷新令牌,这些令牌都可以使用,但是在50个令牌之后,第一个令牌将过期.

访问令牌会在一个小时后过期,您可以使用刷新令牌来请求新令牌.

Access tokens expire after an hour and you use the refresh token to request a new one.

这篇关于Google云端硬盘API的刷新令牌何时过期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆