jdbcDigestAuthentication仅在提供哈希时有效

编程入门 行业动态 更新时间:2024-10-28 13:22:53
本文介绍了jdbcDigestAuthentication仅在提供哈希时有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我开始设置基本身份验证的项目。我现在想切换到摘要式身份验证。问题是只有在我提供实际密码的哈希值而不是实际密码时才验证身份验证。

I started a project setting up basic authentication. I now want to switch to Digest Authentication. The problem is that the authentication is validated only if I provide the hash of the actual password, and not the actual password.

我做了以下操作从BASIC切换到DIGEST :

I did the following to switch from BASIC to DIGEST:

  • 在我的web.xml中将auth-method改为DIGEST

  • changed in my web.xml the auth-method to DIGEST

    在我的数据库中将我的JDBC Realm的JAAS上下文更改为jdbcDigestRealm

    changed the JAAS context of my JDBC Realm to "jdbcDigestRealm"

    我曾经将password作为密码,我改为MD5的结果(webuser:postgres:webuser)(其中webuser是登录名,webuser是密码,postgres是领域),换句话说,我将表中的密码设置为c3c2681ed07a5a2a5cb772061a8385e8。

    in my db, I used to have "password" as a password, I changed in to the result of MD5(webuser:postgres:webuser) (where webuser is the login, webuser is the password, and postgres is the realm), in other words I set the password in my table to c3c2681ed07a5a2a5cb772061a8385e8.

    我遇到的问题是,当我尝试访问资源时,浏览器会显示登录弹出窗口,但使用 webuser因为密码不起作用。但是,使用c3c2681ed07a5a2a5cb772061a8385e8作为密码可以正常工作。看起来我还处于BASIC身份验证模式。

    The problem I have is that the login popup is displayed by the browser when I try to access the resource, but using "webuser" as the password doesn't work. However, using "c3c2681ed07a5a2a5cb772061a8385e8" as the password works. It looks like I'm still in BASIC authentication mode.

    任何线索?

    谢谢!

    推荐答案

    DIGEST auth方法与HTTP摘要式身份验证相同。它只是加密浏览器和服务器之间的通信。服务器仍然以明文形式提供密码。

    The DIGEST auth-method is same as HTTP Digest Authentication. It just encrypts the communication between the browser and the server. The server still has the password in plain text.

    来自 java.boot.by/wcd-guide/ch05s03.html :

    基本身份验证和摘要身份验证之间的区别在于,在浏览器和服务器之间的网络连接上,密码是加密,即使在非SSL连接上也是如此。在服务器中,密码可以以明文或加密文本存储,对于所有登录方法都是如此,并且与应用程序部署者的选择无关。

    The difference between basic and digest authentication is that on the network connection between the browser and the server, the password is encrypted, even on a non-SSL connection. In the server, the password can be stored in clear text or encrypted text, which is true for all login methods and is independent of the choice that the application deployer makes.

    您应该设置 JDBC的 digest-algorithm 属性领域到 MD5 。之后,JDBC Realm将对密码进行哈希处理。

    You should set the digest-algorithm property of your JDBC Realm to MD5. After that the JDBC Realm will hash the password.

  • 更多推荐

    jdbcDigestAuthentication仅在提供哈希时有效

    本文发布于:2023-11-13 21:32:57,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1585373.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:jdbcDigestAuthentication

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!