cas源码心得

/*配置文件内容:
#设置jdbc认证
cas.authn.jdbc.query[0].url=jdbc:mysql://127.0.0.1:3306/springdemo?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8
cas.authn.jdbc.query[0].user=root
cas.authn.jdbc.query[0].password=****
cas.authn.jdbc.query[0].driverClass=com.mysql.jdbc.Driver
cas.authn.jdbc.query[0].sql=select * from user where name=?
cas.authn.jdbc.query[0].fieldPassword=password

*其中fieldPassword是指数据库中用户表的密码字段
*
*/
public
class QueryDatabaseAuthenticationHandler extends AbstractJdbcUsernamePasswordAuthenticationHandler {//这个是cas默认的jdbc验证方式 private final String sql;//这个是获取配置文件中的sql命令 private final String fieldPassword; private final String fieldExpired; private final String fieldDisabled; private final Map<String, Object> principalAttributeMap; public QueryDatabaseAuthenticationHandler(final String name, final ServicesManager servicesManager, final PrincipalFactory principalFactory, final Integer order, final DataSource dataSource, final String sql, final String fieldPassword, final String fieldExpired, final String fieldDisabled, final Map<String, Object> attributes) { super(name, servicesManager, principalFactory, order, dataSource); this.sql = sql; this.fieldPassword = fieldPassword; this.fieldExpired = fieldExpired; this.fieldDisabled = fieldDisabled; this.principalAttributeMap = attributes; if (StringUtils.isBlank(this.fieldPassword)) { LOGGER.warn("When the password field is left undefined, CAS will skip comparing database and user passwords for equality " + ", (specially if the query results do not contain the password field)," + "and will instead only rely on a successful query execution with returned results in order to verify credentials"); } }

如何修改cas 的jdbc验证方式,做更多自定义的操作?

 

转载于:https://www.cnblogs.com/ljangle/p/10268224.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值