public RuleResult CheckPassword(string username, string password)
        {
            if (!Regex.IsMatch(password, "[0-9]+"))
            {
                return(RuleResult.CreateFailResult("The password must contain at least one number"));
            }

            return(RuleResult.CreatePassResult());
        }
        public RuleResult CheckPassword(string username, string password)
        {
            if (String.IsNullOrEmpty(password))
            {
                return(RuleResult.CreateFailResult("A password value must be provided"));
            }

            return(RuleResult.CreatePassResult());
        }
Ejemplo n.º 3
0
        public RuleResult CheckPassword(string username, string password)
        {
            if (password.Length < 8)
            {
                return(RuleResult.CreateFailResult("The password must be 8 characters in length or greater"));
            }

            return(RuleResult.CreatePassResult());
        }
        public RuleResult CheckPassword(string username, string password)
        {
            if (this.HasPasswordBeenUsedBefore(username, password))
            {
                return(RuleResult.CreateFailResult($"You have entered a password that you have used before.  Please enter a new password"));
            }

            return(RuleResult.CreatePassResult());
        }
        public RuleResult CheckPassword(string username, string password)
        {
            if (!Regex.IsMatch(password, "[A-Z]+", RegexOptions.IgnoreCase))
            {
                return(RuleResult.CreateFailResult("The password must contain at least one letter"));
            }

            return(RuleResult.CreatePassResult());
        }
        public RuleResult CheckPassword(string username, string password)
        {
            String usernameRegex = String.Format("({0})+", username);

            if (Regex.IsMatch(password, usernameRegex, RegexOptions.IgnoreCase))
            {
                return(RuleResult.CreateFailResult($"Your username of {username} may not be used as part of the password"));
            }

            return(RuleResult.CreatePassResult());
        }