过期后如何生成google日历"refresh token"?
How to generate google calendar "refresh token" after expired?
我们正在使用 google 的日历 API,它运行良好,我们几乎达到了所有要求。
但是我们停留在下面的点上,
如何在撤销或过期后生成新的 "Refresh Token"?
我还需要有关 "Refresh Token" 何时过期的更多信息,以及我如何知道此刷新令牌的寿命,以便我可以在它过期之前自动创建新的?
非常感谢任何答案。
您可能需要查看此相关 SO post, refresh token doesn't expires unless the user revokes it. Until it does, your app must catch this issue then ask the user for permission in order to avoid encountering such problem. Here is the link 以获得 Google 的文档:
Save refresh tokens in secure long-term storage and continue to use
them as long as they remain valid. Limits apply to the number of
refresh tokens that are issued per client-user combination, and per
user across all clients, and these limits are different. If your
application requests enough refresh tokens to go over one of the
limits, older refresh tokens stop working.
如果您要继续阅读直到 令牌到期:
You must write your code to anticipate the possibility that a granted refresh token might no longer work. A refresh token might stop working for one of these reasons:
- 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.
希望这能澄清您的顾虑。
我们正在使用 google 的日历 API,它运行良好,我们几乎达到了所有要求。
但是我们停留在下面的点上, 如何在撤销或过期后生成新的 "Refresh Token"?
我还需要有关 "Refresh Token" 何时过期的更多信息,以及我如何知道此刷新令牌的寿命,以便我可以在它过期之前自动创建新的?
非常感谢任何答案。
您可能需要查看此相关 SO post, refresh token doesn't expires unless the user revokes it. Until it does, your app must catch this issue then ask the user for permission in order to avoid encountering such problem. Here is the link 以获得 Google 的文档:
Save refresh tokens in secure long-term storage and continue to use them as long as they remain valid. Limits apply to the number of refresh tokens that are issued per client-user combination, and per user across all clients, and these limits are different. If your application requests enough refresh tokens to go over one of the limits, older refresh tokens stop working.
如果您要继续阅读直到 令牌到期:
You must write your code to anticipate the possibility that a granted refresh token might no longer work. A refresh token might stop working for one of these reasons:
- 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.
希望这能澄清您的顾虑。