开发者

Glassfish containter security authentication - how to add salt (j_security_check)

开发者 https://www.devze.com 2023-04-13 00:11 出处:网络
How to add salt when I want to authenticate users using web.xml security (j_username, j_password, j_security_check)?

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号