コード例 #1
0
        public void CompPswHasherNewPasswordWrongIsInvalidated()
        {
            string password = "******";
            string passwordHash = "AC+tJ8TKBFjaPAbHVU6mNyiqRI9VrORSeDkHCiO1mhhGU8l0hagUjKHfwVxHFw8haw==";

            var hasher = new CompatiblePasswordHasher();
            var response =
                hasher.VerifyHashedPassword(passwordHash, password);
            response.Should().Be(PasswordVerificationResult.Failed);
        }
コード例 #2
0
        public void CompPswHasherOldPasswordWrongIsInvalidated()
        {
            string password = "******";
            string passwordHash = "1ehCx5Hrf+jFerHOYxcc/dJL1rw=";
            string passwordSalt = "ZDuD1AHT6zA2v9AWHof7fA==";
            string passwordType = "1";

            var hasher = new CompatiblePasswordHasher();
            var response =
                hasher.VerifyHashedPassword(
                    string.Format("{0}|{1}|{2}", passwordHash, passwordType, passwordSalt),
                    password);
            response.Should().Be(PasswordVerificationResult.Failed);
        }