简体   繁体   English

OAuth2.0-刷新令牌的最大请求数

[英]OAuth2.0 - maximum requests for refresh token

使用刷新令牌获得全新访问令牌的请求数量是否有上限?

Access tokens have a lifetime of 3600 seconds. 访问令牌的寿命为3600秒。 Requesting a new access token before that time is up works fine but it's inefficient for your app to do so often. 在此时间之前请求新的访问令牌可以很好地工作,但是对于您的应用而言,这样做通常效率不高。 I don't think Google publishes a limit on how many non-expired access tokens a refresh token can have but you may get errors and it's non-optimal. 我认为Google不会对刷新令牌可以包含多少个未过期的访问令牌发布限制,但是您可能会遇到错误,并且它不是最佳的。

For most apps, refreshing an access token 10 minutes before the current access token expires (later if your not to worried about clock drift) works well. 对于大多数应用程序,在当前访问令牌到期前十分钟刷新访问令牌(如果您不必担心时钟漂移,可以稍后刷新)效果很好。

The number of requests depend on the authorization server security policy. 请求的数量取决于授权服务器的安全策略。 Some servers allow only one request (the refresh token is invalidate after the request), other servers may allow 10, 100 or even unlimited requests. 一些服务器仅允许一个请求(刷新令牌在请求后无效),其他服务器可能允许10、100甚至无限个请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM