Why do my Office 365 OAuth2 refresh tokens keep expiring so quickly?

爷,独闯天下 提交于 2019-12-05 19:42:40

Usually, the access token lasts 1 hours, the refresh token lasts 14 days.

According to the document Authorization Code Grant Flow, the lifetime of refresh token varies based on policy settings. In this case, you may check the Azure AD policy settings.

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.

When the access token expires, you can use the Refresh Token to Request a New Access Token. The response including a new access token and a new refresh token.

The old refresh token will last 14 days, as a workaround, you can use the new refresh token which will lasts another 14 days.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!