Always return current ClientRegistration in `loadAuthorizedClient`
This changes `InMemoryOAuth2AuthorizedClientService.loadAuthorizedClient`
(and its reactive counterpart) to always return `OAuth2AuthorizedClient`
instances containing the current `ClientRegistration` as obtained from
the `ClientRegistrationRepository`.
Before this change, the first `ClientRegistration` instance was cached,
with the effect that any changes made in the `ClientRegistrationRepository`
(such as a new client secret) would not have taken effect.
Closes gh-15511
@ -80,7 +80,13 @@ public final class InMemoryOAuth2AuthorizedClientService implements OAuth2Author
@@ -80,7 +80,13 @@ public final class InMemoryOAuth2AuthorizedClientService implements OAuth2Author
@ -62,8 +62,19 @@ public final class InMemoryReactiveOAuth2AuthorizedClientService implements Reac
@@ -62,8 +62,19 @@ public final class InMemoryReactiveOAuth2AuthorizedClientService implements Reac
Assert.hasText(clientRegistrationId,"clientRegistrationId cannot be empty");
Assert.hasText(principalName,"principalName cannot be empty");
@ -79,9 +79,11 @@ public class InMemoryOAuth2AuthorizedClientServiceTests {
@@ -79,9 +79,11 @@ public class InMemoryOAuth2AuthorizedClientServiceTests {
@ -124,7 +126,35 @@ public class InMemoryOAuth2AuthorizedClientServiceTests {
@@ -124,7 +126,35 @@ public class InMemoryOAuth2AuthorizedClientServiceTests {
@ -148,7 +178,7 @@ public class InMemoryOAuth2AuthorizedClientServiceTests {
@@ -148,7 +178,7 @@ public class InMemoryOAuth2AuthorizedClientServiceTests {
@ -180,4 +210,29 @@ public class InMemoryOAuth2AuthorizedClientServiceTests {
@@ -180,4 +210,29 @@ public class InMemoryOAuth2AuthorizedClientServiceTests {
@ -153,11 +156,37 @@ public class InMemoryReactiveOAuth2AuthorizedClientServiceTests {
@@ -153,11 +156,37 @@ public class InMemoryReactiveOAuth2AuthorizedClientServiceTests {
@ -246,4 +275,31 @@ public class InMemoryReactiveOAuth2AuthorizedClientServiceTests {
@@ -246,4 +275,31 @@ public class InMemoryReactiveOAuth2AuthorizedClientServiceTests {