As of Spring Security doc: 34.1 @EnableWebMvcSecurity states, the @EnableWebMvcSecurity
was replaced by @EnableWebSecurity
.
But when I try
I haven't tried it, but this should work for you:
@Configuration
public class MvcConfig extends WebMvcConfigurerAdapter {
@Bean
public AuthenticationPrincipalArgumentResolver authenticationPrincipalArgumentResolver(){
return new AuthenticationPrincipalArgumentResolver();
}
@Override
public void addArgumentResolvers(List argumentResolvers) {
argumentResolvers.add(authenticationPrincipalArgumentResolver());
}
}