tomcat-jaas-valve-demo demo to show, how to combine jaas loginmodule and tomcat-valve to handle token-based and form-based authentication. Further reading: How to setup Tomcat How to test with testservlet