How confd can prompt customized errors on entering the invalid password according to the password-policy?

An example taken from a reply in 2021 on a similar topic: Sha-512 encryption - #2 by cohult

    type string {
      pattern ".*[0-9]+.*" {
        error-message "The password must have at least one digit";
      }
      pattern ".*[a-z]+.*" {
        error-message "The password must have at least one lower case alpha";
      }
      pattern ".*[A-Z]+.*" {
        error-message "The password must have at least one upper case alpha";
      }
      pattern ".*[<>~;:!@#/$%^&*=-]+.*" {
        error-message "The password must have at least one of these symbols: [<>~;:!@#/$%^&*=-]+";
      }
      pattern ".* .*" {
        modifier invert-match;
        error-message "The password must have no spaces";
      }
      length "8..max" {
        error-message "The password must be at least 8 characters long";
      }
    }
1 Like