Shiro 自定义密码校验:
数据库
两步:加密
1.自定义类MyCredentialsMatcher实现CredentialsMatcher接口spa
2.实现boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)方法token
第一个参数是登录的用户
接口
第二个通常是数据库里面的用户(io
也就是 protected AuthenticationInfo doGetAuthenticationInfo()方法返回的实体和凭据密码
(AuthenticationInfo 即用户名/已加密的密码,盐,realName))
方法
3.实现比对逻辑返回Boolean值true经过,false不经过数据