記事のディレクトリ
まず、展開CAS
Webアプリケーションへ1.コピーcas.war
Tomcatのに次のcas.warのwebappsには、Tomcatを開始することができます
2.ログインページ
二、CASサーバの設定
2.1。ユーザーを追加します
- 指定されたファイルを検索
- に行を追加します。
<bean id="primaryAuthenticationHandler"
class="org.jasig.cas.authentication.AcceptUsersAuthenticationHandler">
<property name="users">
<map>
<entry key="casuser" value="Mellon"/>
<entry key="admin" value="admin"/>
</map>
</property>
</bean>
2.2。ポートを変更します。
我々はアクセスCASにポート8080を使用したくない場合は、ポートを変更することができます
- ①変更TOMCATポート
tomcatディレクトリを開きすることはconfに\ server.xmlの次のような構成を見つけます
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
に改訂
<Connector port="9100" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
ポート8080ではなく9100
- ②CASの変更設定ファイル
WEB-INFを変更CAS / cas.properties
8080 9100に修正
server.name=http://localhost:9100
2.3。証明除去HTTPS
- ①WEB-INF / deployerConfigContext.xmlを変更CAS
以下の設定を見つけます
<!-- Required for proxy ticket mechanism. -->
<bean id="proxyAuthenticationHandler"
class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
p:httpClient-ref="httpClient"/>
変更されました
<!-- Required for proxy ticket mechanism. -->
<bean id="proxyAuthenticationHandler"
class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
p:httpClient-ref="httpClient" p:requireSecure="false"/>
これは、パラメータを増やす必要がありp:requireSecure="false"
、requireSecure属性は安全な認証の必要性を意味し、つまり、HTTPS、虚偽が使用されていません
- ②変更ticketGrantingTicketCookieGenerator.xml
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" />
設定を変更した後
<bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
p:cookieSecure="false"
p:cookieMaxAge="3600"
p:cookieName="CASTGC"
p:cookiePath="/cas" />
参数p:cookieSecure="true",同理为HTTPS验证相关,TRUE为采用HTTPS验证,FALSE为不采用https验证。
参数p:cookieMaxAge="-1",是COOKIE的最大生命周期,-1为无生命周期,即只在当前打开的窗口有效,关闭或重新打开其它窗口,仍会要求验证。可以根据需要修改为大于0的数字,比如3600等,意思是在3600秒内,打开任意窗口,都不需要验证。
我们这里将cookieSecure改为false , cookieMaxAge 改为3600
- ③変更warnCookieGenerator.xmlは、
CASのWEB-INF /春-設定は/修正
以下の構成を見つけ、ここで我々はcookieSecureがfalseに変更されます、cookieMaxAgeは3600に変更しました
<bean id="warnCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
p:cookieSecure="true"
p:cookieMaxAge="-1"
p:cookieName="CASPRIVACY"
p:cookiePath="/cas" />
に改訂
<bean id="warnCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
p:cookieSecure="false "
p:cookieMaxAge="3600"
p:cookieName="CASPRIVACY"
p:cookiePath="/cas" />
HTTPプロトコルは、近くにHTTPSプロトコルを有効に