Ejemplo n.º 1
0
        private async static void Login()
        {
            if (loggedUser != null && clientAccount != null)
            {
                return;
            }
            Binding         binding = new BasicHttpBinding();
            EndpointAddress address = new EndpointAddress(ServerUrl);

            wsdl = new TaskDatabaseSoapClient(binding, address);
            string salt = await wsdl.GetUserSaltAsync(UserName);

            string hashedPasword = CreateHash1(Password, salt);
            string finalPassword = CreateHash2(hashedPasword, salt);

            loggedUser = await wsdl.LoginUser2Async(UserName, finalPassword);

            clientAccount = await wsdl.GetAccountForClientAsync(loggedUser.InternalId, Guid.Parse(ClientRegistrationID));
        }