一 点睛
1 Shiro散列配置
-
HashedCredentailsMatcher
-
自定义Realm中使用散列
-
盐的使用
二 实战
1 新建pom
<dependencies>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>RELEASE</version>
</dependency>
</dependencies>
2 自定义Realm代码中加MD5算法加盐
package com.liuyanzhao.shiro.realm;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
imp