I want a custom login form to include an additional field. So I plan to provide a custom UsernamePasswordAuthenticationFilter replacing the original FORM_LOGIN_FILTER. I wrote a demo application here . Direct run will be good to login to /index by

mvn jetty:run

I use an old-fashioned style applicationContext.xml config.

Including applicationContext-sec3.xml is a standard config that works fine.

But when I replace it by applicationContext-sec1.xml or applicationContext-sec2.xml (not even change UsernamePasswordAuthenticationFilter), the page always redirects to /login after login success.

The application work find before , Did I do something wrong?

Comment From: jzheaux

Thanks for getting in touch! It feels like this is a question that would be better suited to Stack Overflow. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add more detail if you feel this is a genuine bug.