|
37 | 37 | import org.springframework.security.oauth2.client.registration.ClientRegistration;
|
38 | 38 | import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
|
39 | 39 | import org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter;
|
| 40 | +import org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository; |
40 | 41 | import org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter;
|
41 | 42 | import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
|
42 | 43 | import org.springframework.security.oauth2.core.OAuth2Error;
|
|
66 | 67 | import java.util.List;
|
67 | 68 | import java.util.Map;
|
68 | 69 |
|
69 |
| -import static org.springframework.security.config.http.OAuth2ClientBeanDefinitionParserUtils.createAuthorizedClientRepository; |
70 | 70 | import static org.springframework.security.config.http.OAuth2ClientBeanDefinitionParserUtils.createDefaultAuthorizedClientRepository;
|
71 | 71 | import static org.springframework.security.config.http.OAuth2ClientBeanDefinitionParserUtils.getAuthorizedClientRepository;
|
72 | 72 | import static org.springframework.security.config.http.OAuth2ClientBeanDefinitionParserUtils.getAuthorizedClientService;
|
@@ -136,12 +136,9 @@ public BeanDefinition parse(Element element, ParserContext parserContext) {
|
136 | 136 | BeanMetadataElement authorizedClientRepository = getAuthorizedClientRepository(element);
|
137 | 137 | if (authorizedClientRepository == null) {
|
138 | 138 | BeanMetadataElement authorizedClientService = getAuthorizedClientService(element);
|
139 |
| - if (authorizedClientService == null) { |
140 |
| - this.defaultAuthorizedClientRepository = createDefaultAuthorizedClientRepository(clientRegistrationRepository); |
141 |
| - authorizedClientRepository = this.defaultAuthorizedClientRepository; |
142 |
| - } else { |
143 |
| - authorizedClientRepository = createAuthorizedClientRepository(authorizedClientService); |
144 |
| - } |
| 139 | + this.defaultAuthorizedClientRepository = createDefaultAuthorizedClientRepository( |
| 140 | + clientRegistrationRepository, authorizedClientService); |
| 141 | + authorizedClientRepository = new RuntimeBeanReference(OAuth2AuthorizedClientRepository.class); |
145 | 142 | }
|
146 | 143 | BeanMetadataElement accessTokenResponseClient = getAccessTokenResponseClient(element);
|
147 | 144 | BeanMetadataElement oauth2UserService = getOAuth2UserService(element);
|
|
0 commit comments