PDA

View Full Version : pure javascript login to a secure url



hottubsunshine
02-20-2012, 02:29 AM
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?

keyboard
02-20-2012, 04:21 AM
I'm not answering the question, just informing you of something. Javascript is not secure, nor is there anyway(correct me if I'm wrong) to make it secure. As it is proceced by the browser, the user can see all the javascript code.

traq
02-20-2012, 04:37 AM
correct; you'd need to do your authentication server-side.

you could well use javascript (ajax) to pass the info along to the server, though.

hottubsunshine
02-20-2012, 04:58 AM
it is a html5 app and i need to login into to a secure server to pull the xml rss feed.. i have the username and password already ... I thought there would be a way to pass along those credentials to gain access through javascript

hottubsunshine
02-20-2012, 04:59 AM
how would go about passing that info to the server.

keyboard
02-20-2012, 06:14 AM
Could you please post your code so we can get a better idea of what is needed.

traq
02-20-2012, 03:14 PM
how would go about passing that info to the server.

it depends entirely on how the server is set up to receive it. How is the login handled? is there a script that you need to POST to? Is it an HTTP login (using .htpasswd)?

As keyboard says, we need to see the script you are working with. In addition, we need to know those details about the login process.