protected void logoutButton_Click(object sender, EventArgs e) { // Logout locally. FormsAuthentication.SignOut(); if (SAMLIdentityProvider.IsSSO()) { // Request logout at the service providers. SAMLIdentityProvider.InitiateSLO(Response, null); } else { FormsAuthentication.RedirectToLoginPage(); } }
public ActionResult Logout() { // Logout locally. FormsAuthentication.SignOut(); if (SAMLIdentityProvider.IsSSO()) { // Request logout at the service providers. SAMLIdentityProvider.InitiateSLO(Response, null); return(new EmptyResult()); } return(RedirectToAction("Index", "Home")); }