Answer the question
In order to leave comments, you need to log in
JavaScript Auth with CORS support?
Guys, hello!
I ran into an unexpected problem. Can you suggest a good solution.
There is a website, say www.abc.com and a website, say xyz.ru. There is a script on xyz.ru xyz.ru/auth which, when requested via POST with parameters login=some_login&password=some_password, returns JSON like { status = 0||1 } depending on the correctness of the accepted login/password. On, and actually the site www.abc.com with the form on it www.abc.com/send sends this data (login and password) via AJAX. Through AJAX so that the www.abc.com site itself does not know the real passwords.
How can this mechanism be implemented? Faced the difficulty that IE8-9 generally falls off with CORS requests. And it is necessary that everywhere it works stably.
Answer the question
In order to leave comments, you need to log in
I believe that we are talking about requests through jQuery - $.ajax.
For cross-domain requests in older versions of IE, you need to use XDomainRequest instead of XMLHttpRequest, but it is limited in its capabilities. $.ajax does not support XDomainRequest.
A few links to the topic:
bugs.jquery.com/ticket/8283#comment:43 - why everything is bad
mcgivery.com/ie8-and-cors - and what can be done
jsonp? But then there is no POST.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question