pure javascript login to a secure url

  You are currently not logged in. You can view the forums, but cannot post messages. Log In | Register

19-Feb-12 20:38
I'm in need of connecting to a secure url and passing encrypted string of username and password via pure javascript.

So, to be clear: I have an html5 app that is being ported to iphone via phonegap. The app needs to connect secure url (rss feed that am pulling). I have the username and password encrypted all ready. I just need to connected to it and pass along the parameters to gain access. What is the best way to this?
20-Feb-12 03:54
@coolhandluke: It depends on a lot of things, but I'd probably use jQuery's $.get() method to make an Ajax request to the server-side script, passing the encrypted username and password. Once the server-side script validates the login, it can send back a cookie containing the session ID to the browser, which will automatically store it and send it with all future requests (Ajax or otherwise):

http://www.bennadel.com/blog/1995-AJAX-Requests-Get-And-Set-Cookies-Like-Any-Other-HTTP-Request.htm

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/
28-Feb-12 16:38
The javascript has to be on the same http host as the data it is retrieving because browsers block cross site scripting.

--
Chris.
So long, and thanks for all the fish.
http://webmaster-talk.eu/

 
New posts
Old posts

Follow Elated