Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is encrypting AJAX calls for authentication possible with jQuery?

I'm fairly new to the AJAX methodologies (I only recently discovered jQuery a short time ago). I am interested to know if there is anyway to authenticate a user on a PHP setup; securely.

Does jQuery have any special options to allow use of HTTPS (or any other way to encrypt my ajax call)?

Yes, I could very well just post data back to the server, but that ruins the fun. :)

like image 347
RodgerB Avatar asked Sep 29 '08 09:09

RodgerB


People also ask

Are AJAX requests encrypted?

Since AJAX calls are encrypted with a session key, AJAX queries cannot be sent directly to the server. If an attempt is made to send queries directly, the response given by the page will be "Forbidden," as the page expects to receive encrypted text in the AJAX call.

How can I make AJAX secure call?

AJAX calls are itself protect CSRF using “Common Origin Policy” when CORS is disabled and JSONP requests are blocked. To prevent CSRF attack one step ahead, we can implement Anti Forgery token similar to MVC framework. AJAX calls can be called from web application as well as from MVC. In MVC, @html.

Is AJAX more secure?

AJAX itself will not increase or decrease the security of your site, at least if its implementation is elaborate. The client (browser) will have turned JavaScript on or off. If it is turned on, there may be more insecurities on the client side, but this won't affect your server and hence your site.


2 Answers

To use Ajax over HTTPS, you have to load the originating page over HTTPS.

Same origin policy

So, in a sense, yes -- but, not on its own.

like image 107
Jonathan Lonowski Avatar answered Sep 22 '22 11:09

Jonathan Lonowski


Well, in case you are intrested. There is AES JavaScript implementation. I had lots of fun playing with it :). Still, it might be litte tricky...

like image 36
henrixd Avatar answered Sep 22 '22 11:09

henrixd