Even if context has a valid refresh token, if the authentication server revokes the token or times out, the refresh token may fail. In that case, I want to authenticate again.

Comment From: jgrandja

@ogawa-takeshi The 5.3 release introduced ReactiveOAuth2AuthorizationSuccessHandler and ReactiveOAuth2AuthorizationFailureHandler in #7699, which solves the failed re-authorization as in your use case. If you look at the default ReactiveOAuth2AuthorizationFailureHandler (RemoveAuthorizedClientReactiveOAuth2AuthorizationFailureHandler) in DefaultReactiveOAuth2AuthorizedClientManager, it will remove the OAuth2AuthorizedClient if the re-authorize request fails for specific OAuth 2.0 error codes. This will allow the OAuth 2.0 client to recover and ultimately start over again by authorizing on the following request. You can configure a custom ReactiveOAuth2AuthorizationFailureHandler based on your requirements (if need be) using DefaultReactiveOAuth2AuthorizedClientManager.setAuthorizationFailureHandler().

I'm going to close this issue and associated PR as the new ReactiveOAuth2AuthorizationFailureHandler will solve your use case.