Hi,
W are facing an intermittent error 'A logout response was unexpectedly received' while user logout from the application. We are able to initiate the SLO using SAMLServiceProvider.InitiateSLO method. But this error thrown while SAMLServiceProvider.ReceiveSLO. We are not clear or abandon the ASP.NET session until after calling SAMLServiceProvider.ReceiveSLO.
I have provide the logout code and the SLOService code. Please let me know if you need any additional information.
Logout code ---------------------------------------------------------------------- public ActionResult Logout() { FormsAuthentication.SignOut();
string partnerIdP = WebConfigurationManager.AppSettings["PARTNER_IDP"]; if (SAMLServiceProvider.IsSSO()) { SAMLServiceProvider.InitiateSLO(Response, string.Empty, partnerIdP); return new EmptyResult(); } else { Session.Abandon(); return Redirect("~/"); } } ---------------------------------- End -------------------------------
SLOService code ---------------------------------------------------------------------- public ActionResult SLOService() { bool isRequest = false; string logoutReason = null; string partnerSP = null;
SAMLServiceProvider.ReceiveSLO(Request, out isRequest, out logoutReason, out partnerSP, out string relayState);
if (isRequest) { FormsAuthentication.SignOut(); Session.Abandon(); SAMLServiceProvider.SendSLO(Response, null); } else { Session.Abandon(); FormsAuthentication.RedirectToLoginPage(); } return new EmptyResult(); }
---------------------------------- End -------------------------------
Thanks, Niyas
|