如何在ASP.NET中使用Windows身份验证时注销如此web.config?ASP.NET Windows身份验证注销
<authentication mode="Windows" />
我已经尝试过以下失败。它重定向,但不会注销用户。
void logoutButton_Click(object sender, EventArgs e) {
HttpContext.Current.Session.Clear();
HttpContext.Current.Session.Abandon();
ViewState.Clear();
FormsAuthentication.SignOut();
Response.Redirect("/");
}
背景资料:
我有,因为我需要模拟使用Active Directory来访问本地文件的标识使用Windows身份验证。我不能模仿使用表单身份验证,因为HttpContext.Current.User.Identity
将不是WindowsIdentity
。 Impersonate using Forms Authentication
它似乎通过表单身份验证用户毕竟是可能的。见http://stackoverflow.com/a/11873754/359765 – bgh 2016-07-01 12:21:51