Search code examples
ajaxcorsinternet-explorer-11ntlm

IE11 Ajax CORS request fails specifically when using withCredentials: true + IE local intranet zone set on "Prompt for user name and password"


This is a stupidly specific question -

I have a server that authenticates a user using NTLM authentication then passes information back via a POST call.

If I set IE11's local intranet User Auth Login to "Prompt for user name and password":

Chrome and Edge work perfect, the username and password prompt show and I can authenticate.

IE11 does not work, I get a 401 Unauthorized error.

BUT - If I set the local intranet User Auth Login to "Automatic logon only in Intranet zone", then it DOES work.

Anyone have ideas why IE11 fails when it is set to "Prompt for user name and password"?

example ajax call:

 $.ajax({
                url: 'http://authserv/post_auth',
                method: 'POST',
                dataType: "json",
                data: { grp: 'AUTHTOKENA' },
                xhrFields: {
                    withCredentials: true
                },
                error: function (e) { alert("error attempting authentication."); console.log(e); },
                success: function (a) {
//ETC
}
});

Another note: if I access my server site directly in IE11, I do get the proper username and password prompt.


Solution

  • Well, after not being able to figure out this stupid, pesky IE11 issue, I've decided to implement a workaround. Instead of the CORS post request, I just put my auth server site within an iframe, and once the auth server authenticates, it posts back a message to my parent page. This works in all of my scenarios.