Пример #1
0
        private bool getNpsso(string email, string password)
        {
            HttpResult res = Http.Post(Consts.APIEndpoints.SSO_COOKIE_URL, new
            {
                authentication_type = Consts.UrlParamaters.Authentication_Type,
                username            = email,
                password            = password,
                client_id           = "71a7beb8-f21a-47d9-a604-2e71bee24fe0"
            });

            if (Json.IsKeyExist("error", res.ToString()) || res.HasError)
            {
                throw new PSNException(res.ErrorMessage.AsJson()["error_description"]);
            }
            if (Json.IsKeyExist("ticket_uuid", res.ToString()))
            {
                throw new PSNException("Disable your mobile number (2 steps verfication)");
            }
            dynamic theRes = res.AsJson();

            _npsso = theRes["npsso"].ToString();
            return(true);
        }