CAS账号密码encode
添加依赖cas-server-support-jdbc
build.gradle 中加入
implementation "org.apereo.cas:cas-server-support-jdbc:${casServerVersion}"
cas.authn.accept.enabled =false cas.jdbc.show-sql =true cas.jdbc.gen-ddl =true cas.jdbc.case-insensitive =false cas.authn.jdbc.query[0].user =root cas.authn.jdbc.query[0].password =admin cas.authn.jdbc.query[0].driverClass =com.mysql.cj.jdbc.Driver cas.authn.jdbc.query[0].dialect =org.hibernate.dialect.MySQLDialect cas.authn.jdbc.query[0].url =jdbc:mysql://localhost:3306/cas?serverTimezone=UTC cas.authn.jdbc.query[0].password-encoder.type =DEFAULT cas.authn.jdbc.query[0].password-encoder.character-encoding =UTF-8 cas.authn.jdbc.query[0].password-encoder.encoding-algorithm =MD5 cas.authn.jdbc.encode[0].algorithm-name =MD5 cas.authn.jdbc.encode[0].number-of-iterations =1 cas.authn.jdbc.encode[0].salt-field-name =salt cas.authn.jdbc.encode[0].password-field-name =password cas.authn.jdbc.encode[0].sql =select * from users where username=? cas.authn.jdbc.encode[0].url =jdbc:mysql://localhost:3306/cas?serverTimezone=UTC cas.authn.jdbc.encode[0].dialect =org.hibernate.dialect.MySQLDialect cas.authn.jdbc.encode[0].driverClass =com.mysql.cj.jdbc.Driver cas.authn.jdbc.encode[0].user =root cas.authn.jdbc.encode[0].password =admin cas.authn.jdbc.query[0].sql =SELECT * FROM Users WHERE username=? cas.authn.jdbc.query[0].field-password =password cas.authn.jdbc.query[0].fieldExpired =expired cas.authn.jdbc.query[0].fieldDisabled =disabled
由此,CAS账号的密码加密方式为: MD5(SALT + PASSWORD)