If you look at FormLoginConfigurer, you will see that the UsernamePasswordAuthenticationFilter is created and inserted into the AbstractAuthenticationFilterConfigurer constructor, then there it is assigned to the final F authFilter, so there is no way to replace it in Spring Security 4.1
addFilter () will simply add another filter to the filter list
zydor source
share