如果发布新的刷新令牌,旧的刷新令牌是否仍然有效? [英] Will an old refresh token still be valid if a new refresh token get issued?
本文介绍了如果发布新的刷新令牌,旧的刷新令牌是否仍然有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用程序使用 Google 刷新令牌(从 Google 获取 access_token).我在这里有两个问题:
My application uses a Google refresh token (to get access_token from Google). I have two questions here:
- 我知道 Google 刷新令牌在 6 个月内不会过期(请参阅此处的文档);假设我在 1 月 1 日下午 5:00 获得了一个刷新令牌
refresh_token_old
,我的应用程序在 1 月 1 日下午 5:30 从 Google 请求另一个刷新令牌refresh_token_new
(即,只是30 分钟后),旧的刷新令牌是否仍然有效(显然旧的尚未过期)?-- 基本上,我是在问新发布的 refresh_token 是否清除了旧 refresh_token 的有效性; - 对于访问令牌,
access_token_a
,我使用refresh_token_old
从 Google 获得,在我的应用请求新令牌后它是否仍然有效refresh_token_new代码>?-- 基本上,我问的是新的 refresh_token 是否清除了旧的 refresh_token 获得的 access_token 的有效性,即使该 access_token 尚未过期;
- I know Google refresh token does not expire for 6 months (see the doc here); say I got a refresh token
refresh_token_old
at 5:00pm on Jan 1st , and my application requests another refresh tokenrefresh_token_new
from Google at 5:30pm on Jan 1st (i.e., just 30 minute later), will the old refresh token still be valid (apparently the old one has not been expired)? -- basically, I am asking if the newly issued refresh_token purges the validity of the old refresh_token; - For the access token,
access_token_a
, which I got from Google usingrefresh_token_old
, is it still valid after my app requested the new fresh tokenrefresh_token_new
? -- basically, I am asking if the new refresh_token purges the validity of the access_token obtained by an old refresh_token even if that access_token has not expired;
推荐答案
- 如果六个月未使用刷新令牌,它就会过期.一旦使用,六个月的计时器就会重置.
- 如果您请求刷新令牌,您的应用程序然后请求另一个刷新令牌,您在技术上有两个未完成的刷新令牌,两者都可以工作.您可以继续这样做,一旦达到第一个将过期,就会有多达五十个常设刷新令牌.
- 使用任何刷新令牌创建的任何访问令牌一小时内有效.即使创建它的刷新令牌在那个小时内已过期.创建访问令牌后,无论怎样,它都会工作一个小时.
这篇关于如果发布新的刷新令牌,旧的刷新令牌是否仍然有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文