java - Zoho OAuth 2.0 多次刷新 token

标签 java oauth-2.0 access-token zoho refresh-token

我正在使用 Zoho OAuth 2.0,并且我已按照 https://www.zoho.com/crm/help/api/v2/#oauth-request 中的步骤进行操作获取访问 token 和刷新 token 。但是我有一些问题。

这是一个场景:

1. Get authorization token
2. From authorization token, get  access token and refresh token.
3. After one hour, I use the refresh token. (then I receive a new access token) - As stated here https://www.zoho.com/crm/help/api/v2/#refreshing-tokens
4. After that, another hour, how is it possible for me to get another access token? As refresh token expires in an hour (similar to access token I assume).
5. When I refresh token, only a new access token is given but not a new refresh token. So after one hour I cannot do another refresh again.

有人知道如何实现吗?

最佳答案

我自己有一个类似的用例,但我必须说它的文档很少。您的应用程序应该有一个“静态”刷新 token ,并使用它每小时生成一个新的访问 token 。

Auth ----> Refresh --(every hour)--> Access

因此,对于我的后端,我使用预先生成的刷新 token 并在该小时的时间到时生成访问 token 。使用此访问 token 与 API 进行正常交互。

我建议您阅读来自多个 Zoho 模块的文档,因为它们很差,您可能需要多个示例才能真正理解它,即使您只使用一个模块(大多数时候 auth 部分实际上是相同的)。你可以开始herehere .

关于java - Zoho OAuth 2.0 多次刷新 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52534581/

相关文章:

java - 提高非重复并发 ArrayList 的性能

java - android.view.WindowManager$BadTokenException : Unable to add window -- token android. os.BinderProxy@aba286f 无效;您的 Activity 正在运行吗?

symfony - FOSOAuthServerBundle:将 access_token 嵌入授权 header 中

rest - 基于 token 的身份验证 (TBA) - OAuth - Netsuite - 其余网络服务 - 无效的登录尝试

go - 在 Go 中使用 google oauth2

facebook - 使用 Facebook Graph API v3.0 列出群组事件

Keycloak 访问 token 过早过期

Java:如何导出使用 .txt 文件的程序?

java - 我正在使用 servlet,我被困在一个点上,我只想更新那些使用复选框选择的行

facebook - 如何使用 OAuth 2.0 获取 Facebook 访问 token