Exemplo n.º 1
0
        internal string GetChallengeMessageString(string csrfToken)
        {
            var api = new ApiRequestChallengeMessage
            {
                CsrtToken         = csrfToken,
                DeviceId          = DeviceId,
                Guid              = Guid,
                LoginAttemptCount = "1",
                Password          = Password,
                PhoneId           = PhoneId,
                Username          = Username,
                AdId              = AdId
            };
            var json = JsonConvert.SerializeObject(api);

            return(json);
        }
Exemplo n.º 2
0
        internal string GenerateChallengeSignature(InstaApiVersion apiVersion, string signatureKey, string csrfToken, out string deviceid)
        {
            if (string.IsNullOrEmpty(signatureKey))
            {
                signatureKey = apiVersion.SignatureKey;
            }
            var api = new ApiRequestChallengeMessage
            {
                CsrtToken         = csrfToken,
                DeviceId          = DeviceId,
                Guid              = Guid,
                LoginAttemptCount = "1",
                Password          = Password,
                PhoneId           = PhoneId,
                Username          = Username,
                AdId              = AdId
            };
            var res = CryptoHelper.CalculateHash(signatureKey,
                                                 JsonConvert.SerializeObject(api));

            deviceid = DeviceId;
            return(res);
        }