cas 单点登陆客户端部署问题

宿舍楼顶 发布于 2016/05/25 14:13
阅读 781
收藏 0


说明服务端采用 ja-sig_cas server 组件

客户端部署

1. 添加cas客户端jar包

2. 在web.xml加入filter配置,cas规定有四个必须的配置,我加入的配置如下(在web.xml文件最前面):

<!-- cas 单点登录配置 -->
	<listener>
		<listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
	</listener>
	<filter>
		<filter-name>CAS Single Sign Out Filter</filter-name>
		<filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>CAS Single Sign Out Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<filter>
		<filter-name>CASFilter</filter-name>
		<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
		<init-param>
			<param-name>casServerLoginUrl</param-name>
		
			<param-value>认证中心地址</param-value>
			 
		</init-param>
		<init-param>
			<param-name>serverName</param-name>
			<!-- 改为业务系统的访问地址 -->
			<param-value>http://Lenovo-pc:8080/metaone</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>CASFilter</filter-name>
		<url-pattern>*.do</url-pattern>
	</filter-mapping>
	<filter>
		<filter-name>CAS Validation Filter</filter-name>
		<filter-class>
			org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
		<init-param>
			<param-name>casServerUrlPrefix</param-name>
			<param-value>认证中心地址</param-value>
		</init-param>
		<init-param>
			<param-name>serverName</param-name>
			<!-- 改为业务系统的访问地址 -->
			<param-value>http://Lenovo-pc:8080/metaone</param-value>
		</init-param>
		<init-param>
			<param-name>encoding</param-name>
			<param-value>UTF-8</param-value>
		</init-param>
		<init-param>
			<param-name>redirectAfterValidation</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>CAS Validation Filter</filter-name>
		<url-pattern>*.do</url-pattern>
	</filter-mapping>
	<filter>
		<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
		<filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<filter>
		<filter-name>CAS Assertion Thread Local Filter</filter-name>
		<filter-class>org.jasig.cas.client.util.AssertionThreadLocalFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>CAS Assertion Thread Local Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	
	<!--  -->



现在的问题是:我加入配置后,启动应用,没报错,我访问受保护的资源,怎么没跳转到认证中心去呢?有人知道原因吗?

加载中
返回顶部
顶部