0
我正在使用在以前版本的IIS中工作的模块。尝试Windows授权,但后退自定义登录
它不再有效,因为集成框架,我不能改回经典。
需要客户端尝试访问该网站,如果他们是可以访问该网站的Windows或域用户,根据我们的数据库,他们将自动登录。如果不是,他们将被带到登录页面。
整个网站运行的是default.aspx页面,该页面是每次调用动态生成的,因此我们不能拥有单独的登录页面。
有没有人知道一个模块或方法,使这项工作在IIS 7/7.5?
编辑: 下面是模块生成的JavaScript。看起来好像我总是跳到我返回的位置 location.replace(“/ default.aspx?abortScreening = true”);
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Loading ...</title>
</head>
<body>
<script type="text/javascript" language="javascript">
function canAuthenticate()
{
try
{
alert("Try canAuthenticate");
var dom = new ActiveXObject("Msxml2.DOMDocument.4.0");
dom.async = false;
dom.load("CredentialsScreeningRequiresAuthentication.aspx?ReturnUrl=");
}
catch(e)
{
return false;
}
return true;
}
if (document.cookie.length != 0)
{
if (canAuthenticate())
{
location.reload();
}
else
{
location.replace("/default.aspx");
}
}
else
{
location.replace("/default.aspx?abortScreening=true");
}
</script>
<noscript>
"Your browser does not support JavaScript or has scripting disabled, which prevents credentials screening from working."
Please click <a href="/default.aspx?abortScreening=true">here</a> to go to the requested page without authentication.
</noscript>
</body></html>
所以我最终做的是使用Ajax错误处理程序。我发现401错误设置了一个标志,告诉服务器Windows Auth失败,然后将它们重定向回页面以允许用户登录。 – Levi 2013-03-26 15:08:48
@Levi - Creative解决方案。我喜欢。 – 2013-03-26 15:12:34