File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
main/java/org/springframework/security/config/http
test/java/org/springframework/security/config/http Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 38
38
* @since 5.4
39
39
*/
40
40
final class OAuth2ClientWebMvcSecurityPostProcessor implements BeanDefinitionRegistryPostProcessor , BeanFactoryAware {
41
- private static final String ARGUMENT_RESOLVERS_PROPERTY = "argumentResolvers " ;
41
+ private static final String CUSTOM_ARGUMENT_RESOLVERS_PROPERTY = "customArgumentResolvers " ;
42
42
private BeanFactory beanFactory ;
43
43
44
44
@ Override
@@ -56,7 +56,7 @@ public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) t
56
56
BeanDefinition beanDefinition = registry .getBeanDefinition (beanName );
57
57
if (RequestMappingHandlerAdapter .class .getName ().equals (beanDefinition .getBeanClassName ())) {
58
58
PropertyValue currentArgumentResolvers =
59
- beanDefinition .getPropertyValues ().getPropertyValue (ARGUMENT_RESOLVERS_PROPERTY );
59
+ beanDefinition .getPropertyValues ().getPropertyValue (CUSTOM_ARGUMENT_RESOLVERS_PROPERTY );
60
60
ManagedList <Object > argumentResolvers = new ManagedList <>();
61
61
if (currentArgumentResolvers != null ) {
62
62
argumentResolvers .addAll ((ManagedList <?>) currentArgumentResolvers .getValue ());
@@ -74,7 +74,7 @@ public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) t
74
74
beanDefinitionBuilder .addConstructorArgReference (authorizedClientRepositoryBeanNames [0 ]);
75
75
}
76
76
argumentResolvers .add (beanDefinitionBuilder .getBeanDefinition ());
77
- beanDefinition .getPropertyValues ().add (ARGUMENT_RESOLVERS_PROPERTY , argumentResolvers );
77
+ beanDefinition .getPropertyValues ().add (CUSTOM_ARGUMENT_RESOLVERS_PROPERTY , argumentResolvers );
78
78
break ;
79
79
}
80
80
}
Original file line number Diff line number Diff line change 41
41
import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
42
42
import org .springframework .test .web .servlet .MockMvc ;
43
43
import org .springframework .test .web .servlet .MvcResult ;
44
+ import org .springframework .ui .Model ;
44
45
import org .springframework .util .LinkedMultiValueMap ;
45
46
import org .springframework .util .MultiValueMap ;
46
47
import org .springframework .web .bind .annotation .GetMapping ;
@@ -226,7 +227,7 @@ public void requestWhenAuthorizedClientFoundThenMethodArgumentResolved() throws
226
227
static class AuthorizedClientController {
227
228
228
229
@ GetMapping ("/authorized-client" )
229
- String authorizedClient (@ RegisteredOAuth2AuthorizedClient ("google" ) OAuth2AuthorizedClient authorizedClient ) {
230
+ String authorizedClient (Model model , @ RegisteredOAuth2AuthorizedClient ("google" ) OAuth2AuthorizedClient authorizedClient ) {
230
231
return authorizedClient != null ? "resolved" : "not-resolved" ;
231
232
}
232
233
}
Original file line number Diff line number Diff line change 62
62
import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
63
63
import org .springframework .test .web .servlet .MockMvc ;
64
64
import org .springframework .test .web .servlet .MvcResult ;
65
+ import org .springframework .ui .Model ;
65
66
import org .springframework .util .LinkedMultiValueMap ;
66
67
import org .springframework .util .MultiValueMap ;
67
68
import org .springframework .web .bind .annotation .GetMapping ;
@@ -522,7 +523,7 @@ public void requestWhenAuthorizedClientFoundThenMethodArgumentResolved() throws
522
523
static class AuthorizedClientController {
523
524
524
525
@ GetMapping ("/authorized-client" )
525
- String authorizedClient (@ RegisteredOAuth2AuthorizedClient ("google" ) OAuth2AuthorizedClient authorizedClient ) {
526
+ String authorizedClient (Model model , @ RegisteredOAuth2AuthorizedClient ("google" ) OAuth2AuthorizedClient authorizedClient ) {
526
527
return authorizedClient != null ? "resolved" : "not-resolved" ;
527
528
}
528
529
}
You can’t perform that action at this time.
0 commit comments