Session session = request.getSessionInternal(true);
String username = request.getHeader("JBOSS_TEST_USER_NAME");
String password = request.getHeader("JBOSS_TEST_CREDENTIAL");
log.debug("Test UserName =" + username);
log.debug("Test cred present?:" + (password != null));
Principal principal = realm.authenticate(username,password);
if(principal == null)
{
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return false;
}