Glassfish容器安全认证-如何加盐(j_security_check)

发布于 2024-12-10 11:50:31 字数 167 浏览 4 评论 0原文

当我想使用 web.xml 安全性(j_username、j_password、j_security_check)对用户进行身份验证时如何添加盐?

现在,我使用 MD5 或 SHA256(在安全领域中配置)。

使用 Glassfish 3.1、Java Server Faces 2.1。

How to add salt when I want to authenticate users using web.xml security (j_username, j_password, j_security_check)?

Now, I am using MD5 or SHA256 (configured in Security Realm).

Using Glassfish 3.1, Java Server Faces 2.1.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不美如何 2024-12-17 11:50:31

我一直在寻找相同的功能,但没有找到任何解决方案。在我的项目中,我使用了一个专用的托管 bean 来登录。 Oracle 官方文档中有详细描述。因此,您可以单独获取请求的用户并使用如下方法:

request.login(this.user.getUsername(),this.user.getSalt().concat(this.password));

确保您使用与在 glassfish 上配置的相同的摘要算法。希望有帮助。

I was looking for the same feature and didn't find any solution. For my project I used a dedicated managed bean to logOn. It is fully detail described in the official oracle documentation. Therefore you can separately fetch the requested user and use the method like this:

request.login(this.user.getUsername(),this.user.getSalt().concat(this.password));

Ensure that you use the same digist algorithm as you have configured on glassfish. Hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文