Example #1
0
            public override CredentialRuleValidationResult Validate(string input)
            {
                if (!Regex.IsMatch(input, IdentityDefaults.RegularExpressions.Master))
                {
                    return(CredentialRuleValidationResult.Error("It must contain alpha numeric charathers"));
                }

                return(CredentialRuleValidationResult.Valid());
            }
Example #2
0
            public override CredentialRuleValidationResult Validate(string input)
            {
                if (!input.Any(c => !char.IsLetterOrDigit(c)))
                {
                    return(CredentialRuleValidationResult.Error($"It must contain special charather"));
                }

                return(CredentialRuleValidationResult.Valid());
            }
Example #3
0
            public override CredentialRuleValidationResult Validate(string input)
            {
                var minimumLenghtAttr = GetAttribute(RuleType);
                var minimumLenght     = Convert.ToInt32(minimumLenghtAttr.Value);

                if (input.Length < minimumLenght)
                {
                    return(CredentialRuleValidationResult.Error($"The lenght must be greather or equal than {minimumLenght}"));
                }

                return(CredentialRuleValidationResult.Valid());
            }