Note that there are some explanatory texts on larger screens.

plurals
  1. POCORS authentication in Internet Explorer using JQuery
    primarykey
    data
    text
    <p>I've got a number of questions I <em>could</em> ask but I'll start with this one for now as it's bugging me the most.</p> <p>I have a development environment (intranet zone) and a web service (internet zone) that requires authentication so I'm using CORS. After a lot of research the server's been setup to correctly respond to CORS requests; of this I'm 100% certain. </p> <p>The web service has been setup to allow basic as well as cookie based authentication. For my development environment I've decided to opt for basic as it's nice and simple and works perfectly in Firefox and Chrome. That is, when the web service is called using the following JQuery Ajax, the browser presents a popup and allows me to log in.</p> <pre><code>$.ajax({type:'GET', url:'https://whatever.com/theservice', xhrFields: {'withCredentials': true}, dataType: "json", success: function(response) { //do something } }); </code></pre> <p>The response from the server (abbreviate and for info):</p> <pre><code>HTTP/1.1 401 Unauthorized Access-Control-Allow-Origin: http://mysandbox/ Access-Control-Allow-Headers: content-type Access-Control-Allow-Credentials: true WWW-Authenticate: Basic realm="Realm" </code></pre> <p>However, IE10 does not allow this (does not show the credentials popup) but at least there's a security option that will enable this behaviour: Setting the "Access data sources across domains" option to "Enable" and hey presto, it works like a dream and I start getting the popup. This is acceptable because it's only a development environment and not destined for release in this format.</p> <p>However, when I come to test this same example in IE8/9 (which is necessary unfortunately) with the same security option set, the browser receives the 401 response but does not show the popup. For info, I'm using the <a href="https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest/blob/master/jQuery.XDomainRequest.js" rel="nofollow" title="jQuery.XDomainRequest.js">jQuery.XDomainRequest.js</a> library to add CORS capability for IE8/9.</p> <p>So my question: Am I missing something or does IE8/9 simply not support the basic credentials popup during an Ajax call?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload