1

I have a problem with my javascript.I am working on a project in which I need to ask my costumers to make the login in a server.This server is not mine, and I just need to pick some informations of the account's server.

So basically, all I need is to remotely acess the server, and login with e-mail and password, given by the costumer. How can I do that on Javascript?

I already know part of the solution.I am using two prompt notifications to ask and pick up e-mail and password, respectively. Then, I am using jquery's URL request using the post method to post the data in the server. However, I am not sure if post method can write the inputs on the right places.

Thanks for the attention!

Jeff Puckett
  • 37,464
  • 17
  • 118
  • 167
  • Use JQuery or Jsoup – HelloWorld Mar 06 '17 at 04:19
  • Can you include how you are posting e-mail and password at Question? See [XMLHttpRequest fails basic authentication](http://stackoverflow.com/questions/24216459/xmlhttprequest-fails-basic-authentication) – guest271314 Mar 06 '17 at 04:27
  • This depends quite a lot on the particular service. Client-side JavaScript is restricted by the [Same-Origin Policy](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) and [exceptions to that](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) can only be granted by the remote server (possibly varying by path). Does the server have a documented API? Does it mention any supported authentication schemes, such as OAuth? – Jonathan Lonowski Mar 06 '17 at 04:31
  • 1
    You shouldn't do this. People should not give secret credentials to a 3rd party (your website). If the other site wants to support this behavior (you getting their information about their users) then they should support OAuth (https://oauth.net/2/) which specifically supports this use case. – Chad K Mar 06 '17 at 04:42

0 Answers0