Ejemplo n.º 1
0
        private void HashAccountPassword()
        {
            BCryptHashGenerator bCryptHashGenerator = new BCryptHashGenerator();
            string salt           = bCryptHashGenerator.GenerateSalt();
            string hashedPassword = bCryptHashGenerator.GenerateHashedString(Coordinator.User.Account.Password, salt);

            Coordinator.User.Account.Password = hashedPassword;
        }
Ejemplo n.º 2
0
        private void HashAccountPassword()
        {
            BCryptHashGenerator bCryptHashGenerator = new BCryptHashGenerator();
            string salt           = bCryptHashGenerator.GenerateSalt();
            string hashedPassword = bCryptHashGenerator.GenerateHashedString(Practicioner.User.Account.Password, salt);

            Practicioner.User.Account.Password = hashedPassword;
            Practicioner.User.Account.Salt     = salt;
        }
Ejemplo n.º 3
0
        private void HashAccountPassword()
        {
            BCryptHashGenerator bCryptHashGenerator = new BCryptHashGenerator();
            string salt = bCryptHashGenerator.GenerateSalt();

            account.Salt = salt;
            string hashedPassword = bCryptHashGenerator.GenerateHashedString(account.Password, salt);

            account.Password = hashedPassword;
        }
Ejemplo n.º 4
0
        private bool IsValidAccountPassword()
        {
            BCryptHashGenerator bCryptHashGenerator = new BCryptHashGenerator();
            string hashedPassword = bCryptHashGenerator.GenerateHashedString(accountCurrent.Password, accountReceived.Salt);

            accountCurrent.Password = hashedPassword;
            _password = hashedPassword;
            AccountValidator          accountValidator     = new AccountValidator(accountReceived);
            ValidationResult          dataValidationResult = accountValidator.Validate(accountCurrent);
            IList <ValidationFailure> validationFailures   = dataValidationResult.Errors;
            UserFeedback userFeedback = new UserFeedback(FormGrid, validationFailures);

            userFeedback.ShowFeedback();
            return(dataValidationResult.IsValid);
        }
Ejemplo n.º 5
0
        public void SaveAccount()
        {
            try
            {
                var accountCurrent = _unitOfWork.Accounts.Get(1);
                BCryptHashGenerator bCryptHashGenerator = new BCryptHashGenerator();
                string salt           = bCryptHashGenerator.GenerateSalt();
                string hashedPassword = bCryptHashGenerator.GenerateHashedString("MMOL78945", salt);
                accountCurrent.Password = hashedPassword;
                accountCurrent.Salt     = salt;
            }
            catch (System.NullReferenceException)
            {
            }
            int expected = 1;
            int actual   = _data.Count;

            Assert.AreEqual(expected, actual);
        }