实现单点登录需要在项目中添加一个filer对需要过滤的请求进行单点登录的过滤
添加的FILTER如下:
<filter>
<filter-name>CAS Filter</filter-name>
<filter-class>
edu.yale.its.tp.cas.client.filter.CASFilter
</filter-class>
<init-param>
<param-name>
edu.yale.its.tp.cas.client.filter.loginUrl
</param-name>
<param-value>cas登录地址</param-value>
</init-param>
<init-param>
<param-name>
edu.yale.its.tp.cas.client.filter.validateUrl
</param-name>
<param-value>cas校验地址</param-value>
</init-param>
<init-param>
<param-name>
edu.yale.its.tp.cas.client.filter.logoutUrl
</param-name>
<param-value>cas注销地址</param-value>
</init-param>
<init-param>
<param-name>
edu.yale.its.tp.cas.client.filter.serverName
</param-name>
<param-value>当前系统部署服务的的host地址</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CAS Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
配置此CAS拦截的filter需要如下的jar包