zoukankan      html  css  js  c++  java
  • Shrio的登录验证过程中的密码验证,过程,及relam在applicationContext.xml的配置

    private String hashAlgorithm;    //加密耍法
    private int hashIterations;          //加密次数
    private boolean hashSalted;      //盐值加密
    private boolean storedCredentialsHexEncoded;

    输入密码提交后,后台获取提交的密码与数据中的密码进行比对,在比对前会先进行加密:

     调取加密参数,对对象进行加密

    使用Reaml实现类的方式配置SecurityManager:

    <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
            <property name="cacheManager" ref="cacheManager"/>
            <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
            <!-- <property name="sessionMode" value="native"/> -->
            <!-- Realm,实现类 -->
            <property name="realm" ref="jdbcRealm"/>
        </bean>
     <bean id="jdbcRealm" class="com.shiro.bean.ShiroRealm">
        <!-- 配置密码加密使用MD5加密 -->
             <property name="CredentialsMatcher">
               <bean class="org.apache.shiro.authc.credential.HashedCredentialsMatcher">
                  <property name="hashAlgorithmName" value="MD5"></property>
                  <property name="hashIterations" value="1024"></property>
               </bean>
             </property>
        </bean>
  • 相关阅读:
    Fiddler的使用
    vue后台管理系统搭建
    有效的山脉数组
    从中序与后序遍历序列构造二叉树
    从前序与中序遍历序列构造二叉树
    最大二叉树
    填充每个节点的下一个右侧节点指针
    二叉树展开为链表
    翻转二叉树
    Java判断字符串是否为数字
  • 原文地址:https://www.cnblogs.com/flytogalaxy/p/7693331.html
Copyright © 2011-2022 走看看