I've created manually a new spring FilterChainProxy:
private FilterChainProxy getCustomFilterChainProxy()
{
List<SecurityFilterChain> securityFilterChains = new ArrayList<SecurityFilterChain>();
securityFilterChains.add(new DefaultSecurityFilterChain( new AntPathRequestMatcher("/**"), new MyFilter1()));
securityFilterChains.add(new DefaultSecurityFilterChain( new AntPathRequestMatcher("/admin/**"), new MyFilter2()));
return new FilterChainProxy(securityFilterChains);
}
And considering that I have a new HttpServletRequest, I would like to check the request against the custom FilterChainProxy. Something like this:
FilterChainProxy customFilterChainProxy = getCustomFilterChainProxy();
customFilterChainProxy.doFilter(request, null, (FilterChain) customFilterChainProxy.getFilterChains() );
But I'm struggling in correctly define the FilterChain used in the 3rd parameter of the doFilter() method.
How can I do this ?
Thanks.