将cas.war 部署进tomcat(war包放到webapps下面)
cas/WEB-INF/deployerConfigContext.xml目录下 可查看修改默认密码casuser/Mellon
<bean id="primaryAuthenticationHandler"
class="org.jasig.cas.authentication.AcceptUsersAuthenticationHandler">
<property name="users">
<map>
<entry key="casuser" value="Mellon"/>
</map>
</property>
</bean>
一、CAS修改端口号:
1、修改tomcat端口号9100
2、修改CAS端口号
修改cas的WEB-INF/cas.properties
server.name=http://192.168.188.130:9100
二、去除https认证
CAS默认使用的是HTTPS协议,如果使用HTTPS协议需要SSL安全证书(需向特定的机构申请和购买)。开发测试阶段,可使用HTTP协议。我们这里讲解通过修改配置,让CAS使用HTTP协议
(1)修改cas的WEB-INF/deployerConfigContext.xml,增加p:requireSecure=“false”
<bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
p:httpClient-ref="httpClient" p:requireSecure="false"/>
(2)修改cas的/WEB-INF/spring-configuration/ticketGrantingTicketCookieGenerator.xml 找到下面配置
<bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
p:cookieSecure="true"
p:cookieMaxAge="-1"
p:cookieName="CASTGC"
p:cookiePath="/cas" />
将cookieSecure改为false , cookieMaxAge 改为3600
(3)修改cas的WEB-INF/spring-configuration/warnCookieGenerator.xml
找到下面配置
<bean id="warnCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
p:cookieSecure="true"
p:cookieMaxAge="-1"
p:cookieName="CASPRIVACY"
p:cookiePath="/cas" />
我们这里将cookieSecure改为false , cookieMaxAge 改为3600
基本配置完成