context.publishEvent(new InteractiveAuthenticationSuccesEvent(
context.publishEvent(new InteractiveAuthenticationSuccessEvent(
    public void doFilter(ServletRequest request, ServletResponse response,        FilterChain chain) throws IOException, ServletException {        if (!(request instanceof HttpServletRequest)) {            throw new ServletException("Can only process HttpServletRequest");        }        if (!(response instanceof HttpServletResponse)) {            throw new ServletException("Can only process HttpServletResponse");        }        HttpServletRequest httpRequest = (HttpServletRequest) request;        HttpServletResponse httpResponse = (HttpServletResponse) response;        if (SecurityContextHolder.getContext().getAuthentication() == null) {            Authentication rememberMeAuth =                    rememberMeServices.autoLogin(httpRequest, httpResponse);            if(rememberMeAuth != null) {                SecurityContextHolder.getContext().setAuthentication(rememberMeAuth);                if (logger.isDebugEnabled()) {                    logger.debug(                        "Replaced SecurityContextHolder with remember-me token: '"                        + SecurityContextHolder.getContext().getAuthentication()                        + "'");                }                // Fire event                if (this.context != null) {                    context.publishEvent(new InteractiveAuthenticationSuccesEvent(                            SecurityContextHolder.getContext().getAuthentication(),                            this.getClass()));                }            }        } else {            if (logger.isDebugEnabled()) {                logger.debug(                    "SecurityContextHolder not replaced with remember-me token, as SecurityContextHolder already contained: '"                    + SecurityContextHolder.getContext().getAuthentication()                    + "'");            }        }        chain.doFilter(request, response);    }