context.publishEvent(new InteractiveAuthenticationSuccesEvent(
context.publishEvent(new InteractiveAuthenticationSuccessEvent(
    protected void successfulAuthentication(HttpServletRequest request,        HttpServletResponse response, Authentication authResult)        throws IOException {        if (logger.isDebugEnabled()) {            logger.debug("Authentication success: " + authResult.toString());        }        SecurityContextHolder.getContext().setAuthentication(authResult);        if (logger.isDebugEnabled()) {            logger.debug(                "Updated SecurityContextHolder to contain the following Authentication: '"                + authResult + "'");        }        String targetUrl = (String) request.getSession().getAttribute(ACEGI_SECURITY_TARGET_URL_KEY);        request.getSession().removeAttribute(ACEGI_SECURITY_TARGET_URL_KEY);        if (alwaysUseDefaultTargetUrl == true) {            targetUrl = null;        }        if (targetUrl == null) {            targetUrl = request.getContextPath() + defaultTargetUrl;        }        if (logger.isDebugEnabled()) {            logger.debug(                "Redirecting to target URL from HTTP Session (or default): "                + targetUrl);        }        onSuccessfulAuthentication(request, response, authResult);        rememberMeServices.loginSuccess(request, response, authResult);        // Fire event        if (this.context != null) {            context.publishEvent(new InteractiveAuthenticationSuccesEvent(                    authResult, this.getClass()));        }        response.sendRedirect(response.encodeRedirectURL(targetUrl));    }