# 查看java版本号
java -version
# a查看maven版本号
mvn -v
https://github.com/apereo/cas-overlay-template/tree/5.3
3. 解压、编译、打包
mvn clean package -DskipTests
http://server:8080/cas/login,默认用户名和密码为casuser+Mellon,server是我的机器名称
cas.tgc.secure=false
cas.serviceRegistry.initFromJson=true
"serviceId" : "^(https|http|imaps)://.*"
修改密码
cas\WEB-INF\classes\application.properties,修改
cas.authn.accept.users=admin::admin
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) DEFAULT '' COMMENT '用户名',
`password` varchar(256) DEFAULT NULL COMMENT '登录密码',
`name` varchar(256) DEFAULT NULL COMMENT '用户真实姓名',
`id_card_num` varchar(256) DEFAULT NULL COMMENT '用户身份证号',
`state` char(1) DEFAULT '0' COMMENT '用户状态:0:正常状态,1:用户被锁定',
PRIMARY KEY (`uid`),
UNIQUE KEY `username` (`username`) USING BTREE,
UNIQUE KEY `id_card_num` (`id_card_num`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
insert into user_info(`username`, `password`) values('admin', '123456')
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-jdbc</artifactId>
<version>${cas.version}</version>
</dependency>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-jdbc-drivers</artifactId>
<version>${cas.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.36</version>
</dependency>
# cas.authn.accept.users=casuser::Mellon
#添加jdbc认证
cas.authn.jdbc.query[0].sql=select * from user_info where username = ?
#那一个字段作为密码字段
cas.authn.jdbc.query[0].fieldPassword=password
#配置数据库连接
cas.authn.jdbc.query[0].url=jdbc:mysql://server:3306/cas?characterEncoding=utf8&useSSL=true
cas.authn.jdbc.query[0].dialect=org.hibernate.dialect.MySQLDialect
#数据库用户名
cas.authn.jdbc.query[0].user=root
#数据库密码
cas.authn.jdbc.query[0].password=123456
#mysql驱动
cas.authn.jdbc.query[0].driverClass=com.mysql.jdbc.Driver
cas\WEB-INF\classes\application.properties,新增
#配置加密策略
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
密码修改为:md5(123456) = e10adc3949ba59abbe56e057f20f883e,再次登录。