Ensure ID Token is updated after refresh token (Reactive)#17246
Ensure ID Token is updated after refresh token (Reactive)#17246evgeniycheban wants to merge 1 commit intospring-projects:mainfrom
Conversation
|
Thanks for your patience @evgeniycheban and apologies that I could not get this into I have scheduled this for |
be68a71 to
ac99b3b
Compare
|
Hi @jgrandja, I have rebased my branch and also updated license headers to meet new pattern, let me know your feedback once you review it, thanks. |
|
@evgeniycheban I took a look at the PR and noticed that the implementation is different compared to the Servlet implementation.
The preference is to keep the Servlet and Reactive implementations as close as possible. Is there a reason you did not make use of Just a heads up that I'm on PTO starting tomorrow and returning Jan 5 so I'll reply when I return and we can work through this. |
|
Hi @jgrandja, thank you for reviewing it. The reason I did not use the |
|
@evgeniycheban Got it. I'll do a detailed review next week and we can work towards merging this. |
jgrandja
left a comment
There was a problem hiding this comment.
Thank you for your patience @evgeniycheban.
Overall, this looks good and I believe we are fairly close to merging.
Please see my review comments for further updates.
...ringframework/security/oauth2/client/RefreshTokenReactiveOAuth2AuthorizedClientProvider.java
Outdated
Show resolved
Hide resolved
...gframework/security/oauth2/client/RefreshTokenReactiveOAuth2AuthorizationSuccessHandler.java
Outdated
Show resolved
Hide resolved
...gframework/security/oauth2/client/RefreshTokenReactiveOAuth2AuthorizationSuccessHandler.java
Outdated
Show resolved
Hide resolved
.../client/web/reactive/function/client/ServerOAuth2AuthorizedClientExchangeFilterFunction.java
Show resolved
Hide resolved
...gframework/security/oauth2/client/RefreshTokenReactiveOAuth2AuthorizationSuccessHandler.java
Outdated
Show resolved
Hide resolved
8874f50 to
1ea9456
Compare
1ea9456 to
4e1f26c
Compare
4e1f26c to
0590138
Compare
037e6fb to
38f0a6d
Compare
jgrandja
left a comment
There was a problem hiding this comment.
Thank you for the updates @evgeniycheban. I think we'll be ready to merge after you address some minor feedback.
Also, please add an integration test in ServerOAuth2AuthorizedClientExchangeFilterFunctionITests to ensure RefreshTokenReactiveOAuth2AuthorizationSuccessHandler is fully tested.
| * @author Evgeniy Cheban | ||
| * @since 7.1 | ||
| */ | ||
| public final class RefreshTokenReactiveOAuth2AuthorizationSuccessHandler |
There was a problem hiding this comment.
Please rename to RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandler
| } | ||
|
|
||
| @Override | ||
| public Mono<Void> onAuthorizationSuccess(OAuth2AuthorizedClient authorizedClient, Authentication principal, |
There was a problem hiding this comment.
Please move onAuthorizationSuccess above the setters as it should be right after the members
| } | ||
|
|
||
| private Mono<OAuth2AccessTokenResponse> accessTokenResponse(Map<String, Object> attributes) { | ||
| if (attributes.get(OAuth2AccessTokenResponse.class.getName()) instanceof OAuth2AccessTokenResponse response) { |
There was a problem hiding this comment.
Please move these 2 checks so they are evaluated first, preserving the same order as in OidcAuthorizedClientRefreshedEventListener
|
|
||
| private Function<OAuth2AuthorizeRequest, Mono<Map<String, Object>>> contextAttributesMapper = new DefaultContextAttributesMapper(); | ||
|
|
||
| private ReactiveOAuth2AuthorizationSuccessHandler refreshTokenSuccessHandler = new RefreshTokenReactiveOAuth2AuthorizationSuccessHandler(); |
There was a problem hiding this comment.
Please remove this as authorizationSuccessHandler already defaults to the combined (save/refresh) behaviour and applications can override using setAuthorizationSuccessHandler().
|
Hi @jgrandja, thank you for the review, after we moved |
Closes spring-projectsgh-17188 Signed-off-by: Evgeniy Cheban <mister.cheban@gmail.com>
38f0a6d to
849950f
Compare
Closes gh-17188