I use Apache 1.3.19 & Tomcat 4.0.1 via mod_jk on Linux platform. I try to do this in a servlet :
String authHeader = request.getHeader("Authorization"); if (authHeader != null) { AuthInternaute ai = new AuthInternaute(authHeader); String username = ai.getUsername(); String password = ai.getPassword(); allow = (validUsername.equals(username) && validPassword.equals(password)); } else { response.setHeader("WWW-Authenticate", "BASIC realm=\""+realm+"\""); response.sendError(response.SC_UNAUTHORIZED, "Identification required / Autorisation nécessaire."); } but Apache doesn't respond correctly and send an "Internal Server Error" instead of authentication dialog box. It works fine with tomcat standalone. Perhaps a mod_jk problem, I don't know how to solve this problem. Can someone have ideas ? M.H.