⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 authenticationprocessingfilter.java

📁 pebble-blog 博客源码博客源码博客源码
💻 JAVA
字号:
package net.sourceforge.pebble.security;

import org.acegisecurity.AuthenticationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Overidden to redirect the user to the blog that they were trying to log in to.
 *
 * @author    Simon Brown
 */
public class AuthenticationProcessingFilter extends org.acegisecurity.ui.webapp.AuthenticationProcessingFilter {

  private static final Log log = LogFactory.getLog(AuthenticationProcessingFilter.class);

  /**
   * Overidden to set the value of the defaultTargetUrl property based upon a form parameter.
   *
   * @param request
   * @param response
   * @throws AuthenticationException
   * @throws IOException
   */
  protected void onPreAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException {
//    PebbleContext context = PebbleContext.getInstance();
//    if (context.getConfiguration().isVirtualHostingEnabled()) {
//      Cookie cookie = CookieUtils.getCookie(request.getCookies(), TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY);
//      if (cookie != null) {
//        cookie.setDomain("." + context.getConfiguration().getDomainName());
//        response.addCookie(cookie);
//      }
//    }
//
    setDefaultTargetUrl(request.getParameter("redirectUrl"));
    super.onPreAuthentication(request, response);
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -