*/
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
// Make sure we have a site
Site site = securityService.getSite();
if (site == null)
throw new IllegalStateException("Site context is not available at user lookup");
User user = null;
// Extract the user from the request
if (request instanceof HttpServletRequest) {
HttpServletRequest httpRequest = (HttpServletRequest) request;
user = getUser(site);
if (user != null)
logger.debug("Processing {} as user '{}'", httpRequest.getPathInfo(), site.getIdentifier());
else
logger.debug("No user found for request to {}", httpRequest.getPathInfo());
}
// Set the site and the user on the request