public SAMLLogoutResponse ProcessSamlLogoutResponse(string b64response) { try { byte[] reqDataB64 = Convert.FromBase64String(b64response); string reqData = Encoding.UTF8.GetString(reqDataB64); XmlDocument xml = new XmlDocument(); xml.PreserveWhitespace = true; xml.LoadXml(reqData); SAMLEngine.Instance.Init(); SAMLLogoutResponse samlLogoutResponse = SAMLEngine.Instance.HandleLogoutResponse(xml); return samlLogoutResponse; } catch (Exception e) { _logger.Error(e); SAMLLogoutResponse sr = new SAMLLogoutResponse(); sr.ErrorCode = -11; sr.StatusCode = SAMLConstants.StatusCode.AUTHN_FAILED; sr.StatusMessage = e.Message; return sr; } }