Skip to content

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

Closed
wants to merge 5 commits into from

Conversation

mkheck
Copy link
Contributor

@mkheck mkheck commented May 3, 2019

No description provided.

Copy link
Contributor

@jgrandja jgrandja left a 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.

@jgrandja jgrandja added the in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) label May 6, 2019
@jgrandja jgrandja self-assigned this May 6, 2019
@mkheck
Copy link
Contributor Author

mkheck commented May 7, 2019

Made all requested changes to source+test.

Copy link
Contributor

@jgrandja jgrandja left a 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);
Copy link
Contributor

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")))
Copy link
Contributor

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")))
Copy link
Contributor

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;
Copy link
Contributor

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.

@jgrandja
Copy link
Contributor

jgrandja commented May 9, 2019

@mkheck Closing this PR based on our offline discussion and this comment.

Apologies for the confusion here. Let's find another task for you to take on.

@jgrandja jgrandja closed this May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants