private void addSecurityFilter(WebAppContext ctx) { // The bean name is not arbitrary, but is as expected by Spring Filter f = new DelegatingFilterProxy(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME); ctx.addFilter( new FilterHolder(f), CONFIG.getSpringManagerMapping(), EnumSet.allOf(DispatcherType.class) ); }
@Bean public FilterRegistrationBean securityFilterChain(@Qualifier(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME) Filter securityFilter) { FilterRegistrationBean registration = new FilterRegistrationBean(securityFilter); registration.setOrder(Integer.MAX_VALUE - 2); registration.setName(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME); return registration; }
@Bean public FilterRegistrationBean securityFilterChain(@Qualifier(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME) Filter securityFilter) { FilterRegistrationBean registration = new FilterRegistrationBean(securityFilter); registration.setOrder(Integer.MAX_VALUE - 1); registration.setName(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME); return registration; }