How do you log out when using Windows authentication in ASP.NET like this web.config?
<authentication mode="Windows" />
I have already tried the following unsuccessfully. It redirects but does not log out.
void logoutButton_Click(object sender, EventArgs e) { HttpContext.Current.Session.Clear(); HttpContext.Current.Session.Abandon(); ViewState.Clear(); FormsAuthentication.SignOut(); Response.Redirect("/"); }
Reference Information:
I need to use Windows authentication because I need to personalize my identity using Active Directory in order to access local files. And I can't pretend to use Forms authentication because HttpContext.Current.User.Identity will not be WindowsIdentity . Pretend to use forms authentication
Robert Jul 01 '09 at 4:23 2009-07-01 04:23
source share