private void SendResponse(HttpResponse httpResponse, string URL, string PostFormVariable, string samlResponse)
 {
     List<string> SPLogOutURLs = ConfigurationManager.AppSettings["SPLogOutURLs"].Split(',').Select(s => s.ToString()).ToList();
     if(SPLogOutURLs.Count>0)
     {
         Uri currentURI = new Uri(URL.ToLower());
         foreach (string s in SPLogOutURLs)
         {
             Uri sURL = new Uri(s.ToLower());
             var result = Uri.Compare(currentURI, sURL, UriComponents.Host | UriComponents.PathAndQuery, UriFormat.SafeUnescaped, StringComparison.OrdinalIgnoreCase);
             if (result != 0)
             {
                 using (var client = new WebClient())
                 {
                     var values = new NameValueCollection();
                     values[PostFormVariable] = HttpUtility.HtmlEncode(samlResponse);
                     var response = client.UploadValues(s, values);
                     //var responseString = Encoding.Default.GetString(response);
                 }
             }
         }
     }
     SAMLForm samlForm = new SAMLForm();
     samlForm.ActionURL = URL;
     samlForm.AddHiddenControl(PostFormVariable, samlResponse);
     samlForm.Write(httpResponse);
 }
 private void SendResponse(HttpResponse httpResponse, string URL, string PostFormVariable, string samlResponse)
 {
     SAMLForm samlForm = new SAMLForm();
     samlForm.ActionURL = URL;
     samlForm.AddHiddenControl(PostFormVariable, samlResponse);
     samlForm.Write(httpResponse);
 }
Пример #3
0
        private void SendResponse(HttpResponse httpResponse, string URL, string PostFormVariable, string samlResponse)
        {
            List <string> SPLogOutURLs = ConfigurationManager.AppSettings["SPLogOutURLs"].Split(',').Select(s => s.ToString()).ToList();

            if (SPLogOutURLs.Count > 0)
            {
                Uri currentURI = new Uri(URL.ToLower());
                foreach (string s in SPLogOutURLs)
                {
                    Uri sURL   = new Uri(s.ToLower());
                    var result = Uri.Compare(currentURI, sURL, UriComponents.Host | UriComponents.PathAndQuery, UriFormat.SafeUnescaped, StringComparison.OrdinalIgnoreCase);
                    if (result != 0)
                    {
                        using (var client = new WebClient())
                        {
                            var values = new NameValueCollection();
                            values[PostFormVariable] = HttpUtility.HtmlEncode(samlResponse);
                            var response = client.UploadValues(s, values);
                            //var responseString = Encoding.Default.GetString(response);
                        }
                    }
                }
            }
            SAMLForm samlForm = new SAMLForm();

            samlForm.ActionURL = URL;
            samlForm.AddHiddenControl(PostFormVariable, samlResponse);
            samlForm.Write(httpResponse);
        }
Пример #4
0
        private void SendResponse(HttpResponse httpResponse, string URL, string PostFormVariable, string samlResponse)
        {
            SAMLForm samlForm = new SAMLForm();

            samlForm.ActionURL = URL;
            samlForm.AddHiddenControl(PostFormVariable, samlResponse);
            samlForm.Write(httpResponse);
        }