SpringSecurity 3.2入门(4)登录密码加密

  密码admin 进行MD5 32位加密为21232F297A57A5A743894A0E4A801FC3

  增加spring-security.xml文件配置如下

   <!-- 认证管理器,配置SpringSecutiry的权限信息 -->

    <security:authentication-manager>

        <security:authentication-provider>

            <!-- 帐户信息,指定用户名、密码和权限 -->

            <security:user-service>

                <security:user name="admin" password="21232F297A57A5A743894A0E4A801FC3"

                    authorities="ROLE_ADMIN,ROLE_USER" />

            </security:user-service>



            <!-- 使用md5对密码进行加密 -->

            <security:password-encoder hash="md5" />

            

        </security:authentication-provider>

    </security:authentication-manager>

 

你可能感兴趣的:(SpringSecurity)