IE11 Ajax CORS 请求在使用 withCredentials 时特别失败:true + "Prompt for user name and password" 上设置的 IE 本地 Intranet 区域
IE11 Ajax CORS request fails specifically when using withCredentials: true + IE local intranet zone set on "Prompt for user name and password"
这是一个愚蠢的具体问题 -
我有一个服务器,它使用 NTLM 身份验证对用户进行身份验证,然后通过 POST 调用传回信息。
如果我设置IE11的本地内网用户授权登录为"Prompt for user name and password":
Chrome 和 Edge 工作完美,用户名和密码提示显示,我可以进行身份验证。
IE11 不工作,出现 401 未授权错误。
但是 - 如果我将本地 Intranet 用户身份验证登录设置为 "Automatic logon only in Intranet zone",那么它确实有效。
有人知道为什么 IE11 在设置为 "Prompt for user name and password" 时会失败吗?
示例ajax调用:
$.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
}
});
另请注意:如果我直接在 IE11 中访问我的服务器站点,我会得到正确的用户名和密码提示。
嗯,在无法解决这个愚蠢、讨厌的 IE11 问题之后,我决定实施一个解决方法。我只是将我的 auth 服务器站点放在 iframe 中,而不是 CORS post 请求,一旦 auth 服务器进行身份验证,它 post 就会向我的父页面返回一条消息。这适用于我的所有场景。
这是一个愚蠢的具体问题 -
我有一个服务器,它使用 NTLM 身份验证对用户进行身份验证,然后通过 POST 调用传回信息。
如果我设置IE11的本地内网用户授权登录为"Prompt for user name and password":
Chrome 和 Edge 工作完美,用户名和密码提示显示,我可以进行身份验证。
IE11 不工作,出现 401 未授权错误。
但是 - 如果我将本地 Intranet 用户身份验证登录设置为 "Automatic logon only in Intranet zone",那么它确实有效。
有人知道为什么 IE11 在设置为 "Prompt for user name and password" 时会失败吗?
示例ajax调用:
$.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
}
});
另请注意:如果我直接在 IE11 中访问我的服务器站点,我会得到正确的用户名和密码提示。
嗯,在无法解决这个愚蠢、讨厌的 IE11 问题之后,我决定实施一个解决方法。我只是将我的 auth 服务器站点放在 iframe 中,而不是 CORS post 请求,一旦 auth 服务器进行身份验证,它 post 就会向我的父页面返回一条消息。这适用于我的所有场景。