在realm中设置了缓存
HashedCredentialsMatcher hashedCredentialsMatcher = new HashedCredentialsMatcher();
hashedCredentialsMatcher.setHashAlgorithmName("md5");
hashedCredentialsMatcher.setHashIterations(1024);
initRealm.setCredentialsMatcher(hashedCredentialsMatcher);
initRealm.setCacheManager(new RediscacheManager());
initRealm.setCachingEnabled(true);
initRealm.setAuthenticationCachingEnabled(true);
initRealm.setAuthenticationCacheName("rediscation");
initRealm.setAuthorizationCachingEnabled(true);
initRealm.setAuthorizationCacheName("rediszation");
但是没有走认证的方法
doGetAuthenticationInfo
第一次登录,这个位置报错空指针异常
public class redisCache<k,v> implements Cache<k,v> {
@Autowired
private RedisTemplate redisTemplate;
@Override
public v get(k k) throws CacheException {
System.out.println("缓存get----------"+k);
return (v) redisTemplate.opsForValue().get(k.toString());
}