1、下载https://github.com/apereo/cas-overlay-template 覆盖项目,导入到工程里面去。
2、在main下面新建Application.properties 文件
把etc下面的 log4j2.xml文件转移到resource文件夹下
3、修改pom.xml文件中的repositories,把它改成国内的
所有执行命令需要在所在的工程下执行
启动命令:
build.cmd run
.cmd run
debug命令:
开放了
5000
远程调整端口
build.cmd debug
.cmd debug
打包:
build.cmd package
.cmd package
4、登录的界面 ——默认用户名/密码为:casuser/Mellon
You are currently accessing CAS over a non-secure connection. Single Sign On WILL NOT WORK. In order to have single sign on work, you MUST log in over HTTPS.
CAS只支持https的请求
CAS is configured to accept a static list of users for primary authentication. Please be advised that this is ONLY useful for demo purposes. It is recommended that you connect CAS to LDAP, JDBC, etc instead. 推荐使用jdbc和ldap的方式来
下图为application.properties文件
#
# 版权所有.(c)2008-2017. 卡尔科技工作室
#
##
# CAS Server Context Configuration
#
server.context-path=/cas
server.port=8443
server.ssl.enabled=false
server.max-http-header-size=2097152
server.use-forward-headers=true
server.connection-timeout=20000
server.error.include-stacktrace=NEVER
server.tomcat.max-http-post-size=2097152
server.tomcat.basedir=build/tomcat
server.tomcat.accesslog.enabled=true
server.tomcat.accesslog.pattern=%t %a "%r" %s (%D ms)
server.tomcat.accesslog.suffix=.log
server.tomcat.max-threads=10
server.tomcat.port-header=X-Forwarded-Port
server.tomcat.protocol-header=X-Forwarded-Proto
server.tomcat.protocol-header-https-value=https
server.tomcat.remote-ip-header=X-FORWARDED-FOR
server.tomcat.uri-encoding=UTF-8
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
##
# CAS Cloud Bus Configuration
#
spring.cloud.bus.enabled=false
endpoints.enabled=false
endpoints.sensitive=true
endpoints.restart.enabled=false
endpoints.shutdown.enabled=false
management.security.enabled=true
management.security.roles=ACTUATOR,ADMIN
management.security.sessions=if_required
management.context-path=/status
management.add-application-context-header=false
security.basic.authorize-mode=role
security.basic.enabled=false
security.basic.path=/cas/status/**
##
# CAS Web Application Session Configuration
#
server.session.timeout=300
server.session.cookie.http-only=true
server.session.tracking-modes=COOKIE
##
# CAS Thymeleaf View Configuration
#
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.cache=true
spring.thymeleaf.mode=HTML
##
# CAS Log4j Configuration
#
# logging.config=file:/etc/cas/log4j2.xml
server.context-parameters.isLog4jAutoInitializationDisabled=true
##
# CAS AspectJ Configuration
#
spring.aop.auto=true
spring.aop.proxy-target-class=true
##
# CAS Authentication Credentials
#
cas.authn.accept.users=casuser::Mellon