Google 刷新令牌会过期吗? [英] Do Google refresh tokens expire?

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

问题描述

我在短时间内多次使用刷新令牌进行测试,但我想知道 Google 刷新令牌是否会过期?我可以使用同一个刷新令牌在很长一段时间内(一周甚至几个月)一次又一次地获取另一个访问令牌吗?

I have used the refresh token several times in just a short period for testing purposes, but I wonder whether Google refresh tokens ever expire? Can I use the same refresh token to get another access token again and again for a long period (a week or even months)?

推荐答案

Google Auth 服务器发出的刷新令牌永不过期 — 这就是刷新令牌的全部意义所在.当用户撤销对您的应用程序的访问时,刷新令牌将过期(或者我应该说变得未经授权).

The Google Auth server issued Refresh tokens never expire — that's the whole point of the refresh tokens. The refresh token will expire (or I should say become unauthorized) when the user revokes access to your application.

参考这个 doc 它清楚地说明了刷新令牌的功能.

Refer this doc it clearly states the function of refresh tokens.

与其发行持久代币(通常有效期为一年或无限期),服务器可以发出短期访问令牌和长期刷新令牌.所以简而言之,您可以一次又一次地使用刷新令牌,直到授权访问的用户撤销对您应用程序的访问.

Instead of issuing a long lasting token (typically good for a year or unlimited lifetime), the server can issues a short-lived access token and a long lived refresh token. So in short you can use refresh tokens again and again until the user who authorized the access revokes access to your application.

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

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