Авторизация на ГосУслгуах

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by Radzhab, 12 May 2014.

  1. Radzhab

    Radzhab New Member

    Joined:
    12 Sep 2011
    Messages:
    9
    Likes Received:
    0
    Reputations:
    0
    Хочу авторизоваться на сайте госуслуг.
    Почему то редиректит на главную и не принимает логин-пасс. Мб кто сталкивался?
    ps Юзаю либу xnet.dll

    Code:
      public void postData(string snills, string fio, CookieDictionary cooks)
            {
                using (var request = new HttpRequest())
                {
                    request.Cookies = cooks;
                    request.Referer = "https://esia.gosuslugi.ru/idp/Authn/CommonLogin";
                    request.UserAgent = HttpHelper.ChromeUserAgent();
                    var reqParams = new RequestParams();
                    reqParams["username"] = snills;
                    reqParams["password"] = "password";
                    reqParams["answer"] = "";
                    reqParams["globalRole"] = "RF_PERSON";
                    reqParams["capture"] = "";
                    reqParams["phraseId"] = "";        
                    reqParams["cmsDS"] = "";
                    reqParams["isRegCheck"] = "false";
                    request.AllowAutoRedirect = false;
                    var result =
                            request.Post("https://esia.gosuslugi.ru/idp/Authn/UsernamePasswordLogin", reqParams)
                                   .ToString();
    
                }
    
            }