-
Notifications
You must be signed in to change notification settings - Fork 6k
Implemented solution and tests for "OAuth2AuthorizedClientArgumentResolver should get new access token when expired and client_credentials #6609" #6839
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @mkheck! I've provided some comments inline.
...ork/security/oauth2/client/web/method/annotation/OAuth2AuthorizedClientArgumentResolver.java
Outdated
Show resolved
Hide resolved
...ork/security/oauth2/client/web/method/annotation/OAuth2AuthorizedClientArgumentResolver.java
Outdated
Show resolved
Hide resolved
...ork/security/oauth2/client/web/method/annotation/OAuth2AuthorizedClientArgumentResolver.java
Outdated
Show resolved
Hide resolved
...work/security/oauth2/client/web/reactive/function/client/OAuth2AuthorizedClientResolver.java
Outdated
Show resolved
Hide resolved
...rity/oauth2/client/web/reactive/result/method/annotation/OAuth2AuthorizedClientResolver.java
Outdated
Show resolved
Hide resolved
...rity/oauth2/client/web/reactive/result/method/annotation/OAuth2AuthorizedClientResolver.java
Outdated
Show resolved
Hide resolved
...rity/oauth2/client/web/reactive/result/method/annotation/OAuth2AuthorizedClientResolver.java
Outdated
Show resolved
Hide resolved
...ork/security/oauth2/client/web/method/annotation/OAuth2AuthorizedClientArgumentResolver.java
Outdated
Show resolved
Hide resolved
Made all requested changes to source+test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mkheck, please see my comments for further changes.
@@ -105,6 +105,11 @@ public Object resolveArgument(MethodParameter parameter, | |||
"@RegisteredOAuth2AuthorizedClient(registrationId = \"client1\")."); | |||
} | |||
|
|||
ClientRegistration clientRegistration = this.clientRegistrationRepository.findByRegistrationId(clientRegistrationId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my explanation in this comment, we don't need any changes here as the current implementation does exactly what is required. Please reset the changes here.
@@ -124,14 +124,14 @@ public void setClientCredentialsTokenResponseClient( | |||
|
|||
private Mono<OAuth2AuthorizedClient> authorizedClientNotLoaded(String clientRegistrationId, Authentication authentication, ServerWebExchange exchange) { | |||
return this.clientRegistrationRepository.findByRegistrationId(clientRegistrationId) | |||
.switchIfEmpty(Mono.error(() -> new IllegalArgumentException("Client Registration with id " + clientRegistrationId + " was not found"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any code changes here - just formatting changes. Am I missing something?
@@ -125,14 +125,14 @@ public void setClientCredentialsTokenResponseClient( | |||
|
|||
private Mono<OAuth2AuthorizedClient> authorizedClientNotLoaded(String clientRegistrationId, Authentication authentication, ServerWebExchange exchange) { | |||
return this.clientRegistrationRepository.findByRegistrationId(clientRegistrationId) | |||
.switchIfEmpty(Mono.error(() -> new IllegalArgumentException("Client Registration with id " + clientRegistrationId + " was not found"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any code changes here - just formatting changes. Am I missing something?
@@ -46,9 +46,7 @@ | |||
|
|||
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; | |||
import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; | |||
import static org.mockito.ArgumentMatchers.any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be included since there are no code changes.
No description provided.