@Configuration注入类中添加
@Bean(name = "credentialsMatcher")
public RetryLimitCredentialsMatcher hashedCredentialsMatcher(JedisTemplate jedisTemplate) {
// 设定Password校验的Hash算法与迭代次数.
RetryLimitCredentialsMatcher credentialsMatcher = new RetryLimitCredentialsMatcher(jedisTemplate);
credentialsMatcher.setHashAlgorithmName(Passwords.HASH_ALGORITHM);
credentialsMatcher.setHashIterations(Passwords.HASH_INTERATIONS);
return credentialsMatcher;
}
/**
* FIXME
*/
public static final String HASH_ALGORITHM = "SHA-1";
/**
* FIXME
*/
public static final int HASH_INTERATIONS = 128;
package com.comtop.map.pub.security;
import com.comtop.map.pub.cache.redis.JedisTemplate;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.Aut