Confluence server Oauth2 refresh token failing

Hi @team,

Our application uses the OAuth2 flow. When refreshing the token, if any client-side error occurs (such as a timeout, exception, or network error) and we fail to receive the new access and refresh tokens, we end up without the latest tokens. According to the documentation doc, the old refresh token becomes invalid in such cases. Consequently, when we attempt to refresh the token again, we encounter the following error:

  • Error: Error occurred while getting access token
  • Error Description: The provided refresh_token is invalid
  • Error: invalid_grant

This situation necessitates obtaining admin consent to acquire a new token from the starting point.

However, in Confluence Cloud, using the old refresh token to get a new access token still works even if a new access token and refresh token has already been issued. This effectively handles the issue we face with Confluence Server.

Why do we observe this difference in behavior? Is there a way to avoid token refresh failures in Confluence Server?

Thank you.

1 Like