简体   繁体   English

如果输入了错误的凭据,则防止清除密码字段

[英]Prevent clearing password field if wrong credentials entered

I have noticed on some sites that, when we enter the wrong credentials the password fields becomes encrypted instead of clearing, mean if user enters password *** it will becomes like ********** and password fields doesn't cleared, what is the technique they are using, I am looking for below solution, but didn't find out relevant info:我在一些网站上注意到,当我们输入错误的凭据时,密码字段会被加密而不是清除,这意味着如果用户输入密码 *** 它会变成 ********** 而密码字段不会t清除,他们使用的技术是什么,我正在寻找以下解决方案,但没有找到相关信息:

  1. Prevent browser to clear the password field if wrong credentials.如果凭据错误,防止浏览器清除密码字段。

  2. Encrypt the password before submitting to server in simple JS, and decrypt in server side(I am using JSF), and if wrong credentials the encrypted password should be displayed in field在简单的JS中提交到服务器之前加密密码,并在服务器端解密(我使用的是JSF),如果凭据错误,加密的密码应显示在字段中

They are likely just putting the word "password" in the value.他们可能只是将“密码”一词放在值中。 As for sending it secure I suggest using SSL.至于安全发送,我建议使用 SSL。 SSL is designed for this thing exactly. SSL 正是为此而设计的。 It encrypts the entire webpage and all post data.它加密整个网页和所有发布数据。

If they enter an incorrect value it is best to clear the password field.如果他们输入的值不正确,最好清除密码字段。 You can leave the username/email but should clear the password field.您可以留下用户名/电子邮件,但应清除密码字段。 This is just standard security practice.这只是标准的安全实践。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM