在配置shiro使用redis作为缓存账号多次登陆失败锁定的时候,自定义的密码匹配器进不去,实际根本没调用,求解啊。研究了好久不知道哪写错了。springboot 2 + shiro 1.4 + redis(jedis)
这是shiroconfig的配置:
@Bean("retryLimitHashedCredentialsMatcher")
public RetryLimitHashedCredentialsMatcher matcher(){
RetryLimitHashedCredentialsMatcher matcher = new RetryLimitHashedCredentialsMatcher();
matcher.setHashAlgorithmName("md5");
matcher.setHashIterations(2);
matcher.setStoredCredentialsHexEncoded(true);
return matcher;
}
// 自定义Realm
@Bean("MyRealm")
public MyRealm myRealm(){
MyRealm myRealm=new MyRealm();
myRealm.setCachingEnabled(true);
myRealm.setCacheManager(redisCacheManager());
//启用身份验证缓存
myRealm.setAuthenticationCachingEnabled(true);
//启用授权缓存
myRealm.setAuthorizationCachingEnabled(true);
myRealm.setCrede