让CAS支持HTTP协议认证

CAS默认使用HTTPS认证,在登录时使用HTTP方式也可以,但退出时必须使用HTTPS。如果要使用HTTP方式认证,需要修改2个配置文件

1.修改deployerConfigContext.xml中的authenticationHandlers,新增属性p:requireSecure="false"

<bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" 
		p:httpClient-ref="httpClient"  p:requireSecure="false"/>
 

2.修改ticketGrantingTicketCookieGenerator.xml,把p:cookieSecure="true",改为p:cookieSecure="false"

	<bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
		p:cookieSecure="false"
		p:cookieMaxAge="-1"
		p:cookieName="CASTGC"
		p:cookiePath="/cas" />
   

猜你喜欢

转载自kgd1120.iteye.com/blog/1181184