javascript - What is the best practice for sending password from frontend to API server? - Stack Overflow

I am implementing a web application posed by a Javascript front end (single page application if you pre

I am implementing a web application posed by a Javascript front end (single page application if you prefer), and a Rails backend.

The front end app make request through API to the server, I want to know what is the best practice for sending the password on the login or the password reset.

Should I send the clear password, or should I send the hash?

I think that both of two solutions have their drawbacks:

if I hash the password with JS, the user will have the code in his browser and can understand how I secure the password.

If I keep it clear, beh, it is just clear and so it can be intercepted.

I am implementing a web application posed by a Javascript front end (single page application if you prefer), and a Rails backend.

The front end app make request through API to the server, I want to know what is the best practice for sending the password on the login or the password reset.

Should I send the clear password, or should I send the hash?

I think that both of two solutions have their drawbacks:

if I hash the password with JS, the user will have the code in his browser and can understand how I secure the password.

If I keep it clear, beh, it is just clear and so it can be intercepted.

Share Improve this question asked Jun 10, 2015 at 16:25 ciaobenciaoben 3,3884 gold badges31 silver badges47 bronze badges 2
  • 3 Use https for secure transmission :-) – Shawn Commented Jun 10, 2015 at 16:28
  • 4 Just send it over HTTPS. Some would also remend using POST instead of GET because server logging is less likely to capture the password than if using GET (often times URLS are logged). – jfriend00 Commented Jun 10, 2015 at 16:39
Add a ment  | 

1 Answer 1

Reset to default 4

As long as you're using HTTPS then their password cannot be intercepted. Well.... it probably won't be intercepted. But the tactics that they would have to use in order to capture that password are somewhat out of your control. The user will have to be sure that they are actually connected to your site.

I suggest reading this answer as well.

He goes over what it would take in order to intercept HTTPS munication. Your responsibility would be to make sure that your site only serves over HTTPS and that you have a pletely valid certificate.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745467994a4629001.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信