【发布时间】:2015-03-20 09:48:54
【问题描述】:
我在 tomcat 上集成了一个应用程序来使用 Jasig Cas。现在我已经让整个应用程序(SampleApp)由 CAS 进行身份验证。但是有一个特定的 URL 我需要绕过此身份验证,即 (SampleApp/HomeListener)。
我为此编写了一个新的应用程序过滤器。但是我需要在 Servlet 请求对象中修改什么参数来实现这一点。
过滤器
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class PatternFilter implements Filter {
private FilterConfig config;
public void destroy() {
//nothing here
}
/**
* Filters the HTTP requests
*/
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filter) throws IOException, ServletException {
filter.doFilter(request, response);
}
public void init(FilterConfig filterConfiguration) throws ServletException {
// TODO Auto-generated method stub
config = filterConfiguration;
}
}
【问题讨论】:
-
使用 Spring Security 让您更轻松...
标签: java authentication cas