Google令牌刷新返回“令牌已过期或吊销". [英] Google token refresh returns "Token has been expired or revoked."

查看:883
本文介绍了Google令牌刷新返回“令牌已过期或吊销".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由Google批准的Google OAuth2客户端,它可以为具有所需范围的用户帐户提供离线访问.我的后端应用程序存储并使用 刷新令牌 刷新在需要时 访问令牌 . /p>

最近,我们看到我们的令牌刷新尝试遇到了来自Google的错误:

 {
    "error" : "invalid_grant",
    "error_description" : "Token has been expired or revoked."
}
 

没有其他信息.

我的Google OAuth客户端没有任何更改.用户尚未更改帐户密码.该用户尚未撤消对我的客户端的访问权限.

突然刷新令牌以获取此类错误的原因可能是什么?以及将来如何避免这种情况?

解决方案

您是否无意中多次要求刷新令牌?大约有一个限制.一个帐户可以存在的25个刷新令牌.

I have a Google OAuth2 client approved by Google, which provides offline access to user's account with required scopes. My backend application stores and uses the refresh token to refresh the access tokens as and when needed.

Lately, we are seeing that our token refresh attempt is met with an error from Google with:

{
    "error" : "invalid_grant",
    "error_description" : "Token has been expired or revoked."
}

There is no additional information.

Nothing has changed in my Google OAuth client. The user has not changed account password. The user has not revoked access to my client.

What could be the reason for suddenly getting such errors for token refresh? And how do I avoid this in future (if possible)?

解决方案

Are you inadvertently asking for the refresh token multiple times? There is a limit of approx. 25 refresh tokens that an account can have extant.

这篇关于Google令牌刷新返回“令牌已过期或吊销".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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