一、认证

1、添加凭证匹配器

添加凭证匹配器实现md5加密校验。

修改applicationContext-shiro.xml:

    <!-- realm -->
    <bean id="customRealm" class="com.lhx.ssm.shiro.CustomRealm">
        <!-- 将凭证匹配器设置到realm中,realm按照凭证匹配器的要求进行散列 -->
        <property name="credentialsMatcher" ref="credentialsMatcher"/>
    </bean>

    <!-- 凭证匹配器 -->
    <bean id="credentialsMatcher"
          class="org.apache.shiro.authc.credential.HashedCredentialsMatcher">
        <property name="hashAlgorithmName" value="md5"/>
        <property name="hashIterations" value="1"/>
    </bean>
View Code

相关文章:

  • 2022-12-23
  • 2021-07-16
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-03
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-01-06
相关资源
相似解决方案