If you do not have other reasons specific to Tomcat, or you cannot change your web application, then it would be easier to use a custom filter for authentication (JAAS or otherwise). For instance:
, .
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
String token = request.getParameter("token");
if (token != null) {
doAuthentication(token);
}
chain.doFilter(request, wrapper);
}
JAAS. , , , Tomcat JAASRealm? LoginModule .
, , E-mail .