Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery,sending password via ajax?

Tags:

jquery

I have registration box,and I want users to register via ajax. Is it safe to send password via jquery ajax? If not,can someone explain what to do to secure password data,any example?

like image 725
user147 Avatar asked Nov 04 '10 21:11

user147


4 Answers

Make sure that you're sending it via POST and use SSL rather than plain old http and you should be fine. Sending it via AJAX does not make it less safe than a regular post.

See this answer (and another discussion here) for a more in depth explanation, but the jist of it is that the request you're making, and the information that is transmitted over the wire is fundamentally the same whether its an AJAX request or form submit.

like image 83
Radu Avatar answered Oct 16 '22 20:10

Radu


Just to clarify, there is not a 100% secure method to send any kind of data with Ajax, or even a normal POST.

A good practice is to use SSL/TLS Certificates, if you have a good SSL/TLS certificate nobody can sniff out the password from observing your network traffic.

Unfortunately these services are not free. (*)

If you don't want to pay for something like that and you're building a Sign Up / Log In you can simply use OpenAuth or OpenID and let people join using Social Networks avoiding many security steps both Client and Server side.

*: As suggested by Ivan Venediktov, you can now get a free SSL certificate by following this LINK.

like image 21
Andrea Turri Avatar answered Oct 16 '22 22:10

Andrea Turri


If you're using HTTPS (SSL) (and please do for anything that needs to be secure) then yes an AJAX request is no more or less safe than a full postback to the server.

like image 7
Nick Craver Avatar answered Oct 16 '22 20:10

Nick Craver


It's just as safe/unsafe as sending the password via a full post-back. You need to use an encrypted connection in order for it to be safe(r). Use SSL (https://).

like image 5
Anders Fjeldstad Avatar answered Oct 16 '22 20:10

Anders Fjeldstad