Ejemplo n.º 1
0
        private async Task <string> GetTwoFactorCode(string sharedSecret)
        {
            var timestamp = long.Parse((await GetSteamOffset()).OffsetParameters.ServerTime);
            var twoFaCode = TwoFactorCodeFactory.Create(sharedSecret, timestamp);

            return(twoFaCode);
        }
Ejemplo n.º 2
0
        private DoLoginResponse DoLogin(GetRsaKeyResponse getRsaKeyResponse,
                                        string username, string password, string sharedSecret)
        {
            DoLoginResponse doLoginResponse   = null;
            var             encryptedPassword = EncryptPasswordFactory.Create(getRsaKeyResponse, password);

            var content = PostDataFactory.CreateDoLoginData(username,
                                                            encryptedPassword, getRsaKeyResponse.Timestamp,
                                                            TwoFactorCodeFactory.Create(sharedSecret));

            var response = _requestFactory.Create(HttpMethod.POST,
                                                  Uris.SteamCommunitySecureBase,
                                                  SteamCommunityEndpoints.DoLogin, Accept.All,
                                                  HttpHeaderValues.AcceptLanguageOne, false, true, true, true,
                                                  false, content);

            string responseContent = response.Content.ReadAsStringAsync().Result;

            doLoginResponse =
                JsonConvert.DeserializeObject <DoLoginResponse>(responseContent);
            return(doLoginResponse);
        }