Results 1 to 7 of 7

Thread: pure javascript login to a secure url

  1. #1
    Join Date
    Jan 2012
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default pure javascript login to a secure url

    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?

  2. #2
    Join Date
    Mar 2011
    Location
    N 11 19' 0.0012 E 142 15' 0
    Posts
    1,509
    Thanks
    41
    Thanked 89 Times in 88 Posts
    Blog Entries
    3

    Default

    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.

  3. The Following User Says Thank You to keyboard For This Useful Post:

    hottubsunshine (02-20-2012)

  4. #3
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 517 Times in 503 Posts
    Blog Entries
    5

    Default

    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.

  5. The Following User Says Thank You to traq For This Useful Post:

    hottubsunshine (02-20-2012)

  6. #4
    Join Date
    Jan 2012
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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

  7. #5
    Join Date
    Jan 2012
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    how would go about passing that info to the server.

  8. #6
    Join Date
    Mar 2011
    Location
    N 11 19' 0.0012 E 142 15' 0
    Posts
    1,509
    Thanks
    41
    Thanked 89 Times in 88 Posts
    Blog Entries
    3

    Default

    Could you please post your code so we can get a better idea of what is needed.
    Last edited by keyboard; 02-20-2012 at 05:16 AM. Reason: re-worded my answer to make it more understandible

  9. #7
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 517 Times in 503 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by hottubsunshine View Post
    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •