Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

We are trying to authenticate the site Minder by using httpWebRequest and httpWebResponse and read the cookies. But we are unable to get the cookies

      string url = "https://xxxx/login.jsp";
      string PostData = "USER=" + HttpUtility.UrlEncode("username", Encoding.UTF8) + "&PASSWORD=" + HttpUtility.UrlEncode("passwordval", Encoding.UTF8) + "&rememberMe=" + HttpUtility.UrlEncode("RememberMe", Encoding.UTF8) + "&SMAUTHREASON=" + HttpUtility.UrlEncode("0", Encoding.UTF8) ;
       request = (HttpWebRequest)HttpWebRequest.Create(url);
       request.Method = "POST";
       request.ContentType = "application/x-www-form-urlencoded";          
       request.UserAgent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
        request.AllowAutoRedirect = false;
        StreamWriter sr = new StreamWriter(request.GetRequestStream());
        sr.Write(PostData);
        HttpWebResponse loWebResponse = (HttpWebResponse)request.GetResponse();
        using (StreamReader sr1 = new StreamReader(loWebResponse.GetResponseStream()))
        {
            string page1 = sr1.ReadToEnd();
        }
        foreach (Cookie c in loWebResponse.Cookies)
        {
            Console.WriteLine(c.Name + "=" + c.Value);
            Console.WriteLine(c.Domain);
            Console.WriteLine(c);
        }
        Console.ReadLine();

Please advice

share|improve this question
Your probably going to have better luck with an answer if you post in the SiteMinder forums: communities.ca.com/web/… – Jesus Shelby Feb 1 at 18:48

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.