Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何指定算法=";MD5“;在WWW中使用Spring安全性验证质询响应_Spring_Security_Authentication_Encryption_Header - Fatal编程技术网

如何指定算法=";MD5“;在WWW中使用Spring安全性验证质询响应

如何指定算法=";MD5“;在WWW中使用Spring安全性验证质询响应,spring,security,authentication,encryption,header,Spring,Security,Authentication,Encryption,Header,我的配置设置如下,以利用MD5加密 <authentication-manager > <authentication-provider user-service-ref="userDetailsService" > <password-encoder ref="passwordEncoder"/> </authentication-provider> </authentication-manager> &l

我的配置设置如下,以利用MD5加密

<authentication-manager >
    <authentication-provider user-service-ref="userDetailsService" >
    <password-encoder ref="passwordEncoder"/>
    </authentication-provider>
</authentication-manager>


<beans:bean class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" id="passwordEncoder"/>

,MD5应该是默认的加密算法。然而,由于客户端的需要,我需要我们的服务器直接指定这一点。有谁能帮我实现这一点吗?

你说的“我需要我们的服务器直接指定它”是什么意思?术语说明:MD5不是一种加密形式,而是一种加密哈希函数。加密是双向的(因此是解密)。散列是一种方法,你不能“取消散列”,只能找到冲突。谢谢你的澄清。我的意思是,我们的服务器需要直接指定这一点,即来自服务器的质询响应头需要在WWW Authenticate中包含algorithm=“MD5”。否则,客户机将不知道使用哪种算法来散列对质询的响应。我觉得这应该和在质询响应中添加一个额外的标题字段一样简单,但这似乎有点笨拙。@user2654639似乎您需要在安全性中使用digestAuthenticationFilter:,我不知道您当前的配置,所以我希望该链接会有用