谷歌oauth2刷新令牌限制

时间:2014-02-19 20:52:05

标签: calendar oauth-2.0 google-api google-oauth

我正在开发一个需要使用OAuth2访问100个或更多不同Google日历的网络应用程序。所有日历都与各自的用户在不同的帐户上。我从谷歌那里看到了这段话:

"Note that there are limits on the number of refresh tokens that will be issued; one limit per client/user combination, and another per user across all clients. You should save refresh tokens in long-term storage and continue to use them as long as they remain valid. If your application requests too many refresh tokens, it may run into these limits, in which case older refresh tokens will stop working."

我建议的应用程序正在使用访问令牌,然后将刷新令牌存储在数据库中供以后使用。我想知道我是否会对我的刷新令牌可以使用的日历数量达到限制?有任何人遇到困难之前刷新令牌在达到限制后停止工作。该段提到了两个限制,但我不确定我的应用程序是否会受到影响,因为每个日历都是不同的用户。我不确定谷歌的意思是'和每个用户在所有客户端的另一个限制?

任何有经验或知识的人都可以帮忙。

提前谢谢。

2 个答案:

答案 0 :(得分:4)

这两种限制都不适用于您的方案,因此您不应该遇到任何问题。

“每个客户端/用户组合的一个限制”为25,因此您无法为任何给定用户获得超过25个刷新令牌。但是你只需要一个,所以没关系。

“所有客户中的每位用户”都说: -

  1. 用户只能授权一定数量的项目,但我猜这是一个非常大的数字。
  2. 它说每个项目允许的客户数量有限制,但是你只需要一个。

答案 1 :(得分:2)

以下是显示25个令牌限制的文档: https://developers.google.com/identity/protocols/OAuth2