UserManager PasswordValidator中的空白Json modelState键

时间:2015-06-25 08:30:06

标签: asp.net asp.net-identity modelstate

使用UserManager我设置密码验证:

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

当我通过API拨打电话更改密码时,如果密码无效,我得到的回复是:

{
  "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')."
    ]
  }
}

如何设置该空白modelState键属性?

0 个答案:

没有答案