gpt4 book ai didi

azure - 为什么我的 Office 365 OAuth2 刷新 token 总是很快过期?

转载 作者:行者123 更新时间:2023-12-01 11:27:01 35 4
gpt4 key购买 nike

我知道 Office 365 刷新 token 会在用户更改密码时过期,但我发现我的客户几乎每周都会过期。

在 Azure 中设置 OAuth2 应用程序时,我是否配置错误?

最佳答案

通常,访问 token 的有效期为 1 小时,刷新 token 的有效期为 14 天。

根据文档Authorization Code Grant Flow ,刷新 token 的生命周期根据策略设置而变化。在这种情况下,您可以检查Azure AD策略设置。

The lifetime of the refresh token is not provided and varies based on policy settings and the time when the authorization code grant is revoked by Azure AD. The application should expect and handle cases when the request for a new access token fails. In that case, it should return to the code that requests a new access token.

当访问 token 过期时,您可以使用刷新 token 来请求新的访问 token 。响应包括新的访问 token 和新的刷新 token 。

旧的刷新 token 将持续 14 天,作为解决方法,您可以使用新的刷新 token ,它将再持续 14 天。

关于azure - 为什么我的 Office 365 OAuth2 刷新 token 总是很快过期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36463040/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com