该应用程序将从具有接收访问权限的应用程序列表中消失

The application will disappear from the list of applications with the received access

大家好,首先我很抱歉我蹩脚的英语。

有时,我们在更新令牌时遇到问题,或者更确切地说,我们根本无法使用 refresh_token 这是它的样子:

  1. 我们允许应用程序手动访问并获得第一个 access_token 和 refresh_token。在这个阶段,一切正常,应用程序在被授予访问权限的列表中(通过此页面查看:https://myaccount.google.com/permissions):

  1. AcessToken 成功使用和更新了一段时间(通常是几周),但随后获得访问权限的应用列表中的应用消失了 (https://myaccount.google.com/permissions)

然后消失,就好像有人手动拒绝他访问一样。

当然,最后一个 access_token 停止工作,refresh_token 也停止工作。 之后,我们再次需要手动确认应用程序的第一次访问。因为refresh_token,当然,app从列表中消失后就失效了

请任何人告诉我这可能与什么有关。如果没有人手动限制对应用程序的访问,应用程序会出于什么原因从列表中消失?

可能有一些原因:令牌使用不当等-应用程序可能消失的原因。还是我们不知道的私人账户设置?我们很乐意收到任何建议,在此先感谢您。

如果您的应用程序仍在测试中或尚未通过验证过程,则刷新令牌将在一到两周内过期。这也可能导致应用程序从用户权限中删除,但是我不能说我已经实际检查过但它是有道理的。从 google 端来看,确保刷新令牌过期的最简单方法是撤销用户权限。

将应用设置为正式版并申请验证。应该可以解决问题。

关于@DaImTo 发布的内容;在下面的 documentation 中,您可以找到有关令牌可能失败的不同原因列表的信息,例如:

  • The user has revoked your app's access.
  • The refresh token has not been used for six months.
  • The user changed passwords and the refresh token contains Gmail scopes.
  • The user account has exceeded a maximum number of granted (live) refresh tokens.
  • The user belongs to a Google Cloud Platform organization that has session control policies in effect.

它还声明具有“测试”状态的发布有一个 7 天到期的刷新令牌。

A Google Cloud Platform project with an OAuth consent screen configured for an external user type and a publishing status of "Testing" is issued a refresh token expiring in 7 days.

请记住,还有 50 个刷新令牌的限制,以防您达到此限制。查看参考文档以获取更多信息。