-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth2AuthorizedClientArgumentResolver should get new access token when expired and client_credentials #6609
Comments
I'll take this on. Thanks Joe! |
Great, thanks @mkheck. Let me know if you have any questions along the way. |
@mkheck and @jgrandja, a couple notes on this:
|
You will notice the
After Does this approach work for you? |
Thanks @jgrandja, this clears things up. I do still think we should be able to call the logic within that resolver using a bean on demand if desired though. This way you could create clients that are more self-contained and wouldn't need to add the resolver to the controller. Could we potentially have shared logic being used by both options? |
@fritzdj I'm not sure I'm completely following your idea/suggestion. Can you provide more detail please. |
@jgrandja This makes sense to me, but you would still need to use |
Can you please open a new issue so we can continue this there. Also, can you share the code in the new issue so we can get more into the details. Thanks. |
I re-evaluated this issue and the requirements are not correct. The NOTE: This capability is implemented in The only responsibility for the Given this, I'm going to close this ticket as invalid. |
#6610 is still valuable. I actually use the @RegisteredOAuth2AuthorizedClient in my controller and use the accesstoken to pass it on to a different client. I am not using the WebClient. I have a need to use 3rd party HTTP client that underneath uses the okHTTP client. In this scenario, it would be beneficial for adding the logic to retrieve the access token again if it is expired since the 3rd party client I am using doesn't allow to add the ServletOAuth2AuthorizedClientExchangeFilterFunction. |
@kalyaniyerra Please see #6811 as the goal there is to allow better reuse of the existing logic in |
If the
OAuth2AuthorizedClient.accessToken
is expired for aclient_credentials
OAuth2AuthorizedClient.clientRegistration
than theOAuth2AuthorizedClientArgumentResolver
should handle getting a new access token.This functionality already exists in
ServletOAuth2AuthorizedClientExchangeFilterFunction.authorizeWithClientCredentials()
(Servlet) andServerOAuth2AuthorizedClientExchangeFilterFunction.authorizeWithClientCredentials()
(Reactive).NOTE: This functionality needs to be implemented in both the Servlet and Reactive
OAuth2AuthorizedClientArgumentResolver
.Related #5893
The text was updated successfully, but these errors were encountered: