在ASP中使用Windows身份验证时如何注销.像这样的网络.配置?
<authentication mode="Windows" />
我已经try 过以下方法,但没有成功.它会重定向,但不会注销用户.
void logoutButton_Click(object sender, EventArgs e) {
HttpContext.Current.Session.Clear();
HttpContext.Current.Session.Abandon();
ViewState.Clear();
FormsAuthentication.SignOut();
Response.Redirect("/");
}
背景信息:
我必须使用Windows身份验证,因为我需要使用Active Directory模拟身份才能访问本地文件.我不能用表单身份验证来模拟,因为HttpContext.Current.User.Identity
不会是WindowsIdentity
.