一.打开application.properties
apache-tomcat-cas\webapps\cas\WEB-INF\classes\application.properties
二.进行配置
#默认用户名密码配置
cas.authn.accept.users=admin::admin
#关闭https协议
cas.tgc.secure=false
cas.serviceRegistry.initFromJson=true #在services目录下的HTTPSandIMAPS-10000001.json文件中加入http
#单点登出url service参数启用
cas.logout.followServiceRedirects=true
#数据库配置
cas.authn.jdbc.query[0].url=jdbc:mysql://127.0.0.1:3306/db_name?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
cas.authn.jdbc.query[0].user=root
cas.authn.jdbc.query[0].password=root
cas.authn.jdbc.query[0].sql=select * from tb_user where username=?
cas.authn.jdbc.query[0].fieldPassword=password
cas.authn.jdbc.query[0].driverClass=com.mysql.jdbc.Driver
#密码加密配置
cas.authn.jdbc.query[0].passwordEncoder.type=DEFAULT
cas.authn.jdbc.query[0].passwordEncoder.characterEncoding=UTF-8
cas.authn.jdbc.query[0].passwordEncoder.encodingAlgorithm=MD5
http配置细节
#在services目录下的HTTPSandIMAPS-10000001.json文件中加入http
数据库连接配置细节
需要导入相关jar包