Blank Json modelState key from UserManager PasswordValidator

72 views Asked by At

Using the UserManager I set password validation:

userManager.PasswordValidator = new PasswordValidator
        {
            RequiredLength = 6,
            RequireNonLetterOrDigit = true,
            RequireDigit = false,
            RequireLowercase = true,
            RequireUppercase = true,
        };

When I make a call to change password via an API, the response I get if the password is not valid is:

{
  "message": "The request is invalid.",
  "modelState": {
    "": [
      "Passwords must have at least one non letter or digit character. Passwords must have at least one uppercase ('A'-'Z')."
    ]
  }
}

How do I set that blank modelState key property?

0

There are 0 answers