“令牌已过期或撤销" - Google OAuth2 刷新令牌将在几天内过期 [英] 'Token has been expired or revoked' - Google OAuth2 Refresh token gets expired in a few days

本文介绍了“令牌已过期或撤销" - Google OAuth2 刷新令牌将在几天内过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Google Analytics API 来获取分析数据.我尝试使用以下步骤对其进行身份验证:

  • I am using Google Analytics API to fetch analytics data. I tried to authenticate it using following steps:

    • Created OAuth client ID in https://console.developers.google.com/ credentials section.
    • In consent screen I had set publishing status as testing
    • In OAuth 2.0 Playground I got the refresh token using above generated client id and client secret
    • Then I am using it to generate access token through it.

    But after a few days, the refresh token expires although it is mentioned that the refresh token's validity is life long.

    解决方案

    If your app is in testing mode then user tokens will expire iin 7 days. Please find this explanations here: https://support.google.com/cloud/answer/10311615#zippy=%2Ctesting

    这篇关于“令牌已过期或撤销" - Google OAuth2 刷新令牌将在几天内过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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