1.CAS Server war下載
地址:https://www.jasig.org
github官網(wǎng):https://github.com/apereo/cas
cas服務(wù)端
https://github.com/apereo/cas-overlay-template
https://repo1.maven.org/maven2/cas/
https://repo1.maven.org/maven2/org/apereo/cas/cas-server-webapp-tomcat/5.3.14/
下載支持對(duì)應(yīng)jdk的war包:cas-server-webapp-tomcat/5.3.14/
2.CAS Server war放入webapps目錄下,修改名字為cas.war,啟動(dòng)tomecat自動(dòng)解壓cas文件夾;

cas應(yīng)用
3.打開(kāi)頁(yè)面https://localhost:8443/cas,如圖所示:

cas登錄頁(yè)面
很奇怪,登錄密碼在哪里呢?
別急,打開(kāi)tomcat部署頁(yè)面的文件夾,位置tomcat-9.0\webapps\cas\WEB-INF\classes\application.properties文件,找到這一行
##
# CAS Authentication Credentials
#
cas.authn.accept.users=casuser::Mellon
用戶名:casuser,
密碼:Mellon
4.輸入用戶名,密碼,點(diǎn)擊登錄,登錄成功

登錄成功
5.配置cas日志輸出,配置host
打開(kāi)tomcat-9.0\webapps\cas\WEB-INF\classes\log4j2.xml找到如下行
<Properties>
<Property name="baseDir">/etc/cas/logs</Property>
</Properties>
配置本地域名映射,打開(kāi)C:\Windows\System32\drivers\etc,hosts文件,本地加入hgnu.edu域名映射,保存;
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 activate.navicat.com
127.0.0.1 terminexus.local
127.0.0.1 hgnu.edu
127.0.0.1 localhost
和localhost訪問(wèn)同效果,如圖所示:

登錄成功