Insert password entityframework

Asked

Viewed 25 times

2

I’m trying to insert a user that already exists in another database, but in the previous database, there was no validation of the Entity framework, so for example, the password could be 123456.

So when I use this command:

 var resultado = _userManager.CreateAsync(user, usuario.Senha.Trim()).Result;

But there it returns the error that the password is not validated, that characters are missing, and so on. How can I get around, just to enter this data ?

1 answer

2


When you set up Asp.net Identity you set rules on how it should behave, for example:

services.AddIdentity<AspNetUser, IdentityRole>(options => {
    options.Password.RequiredLength = 6;
    options.Password.RequireDigit = false;
    options.Password.RequireLowercase = false;
    options.Password.RequireNonAlphanumeric = false;
    options.Password.RequireUppercase = false;
})
  • Requires 6 digits
  • Requires no digits
  • Does not require minute letters
  • Does not require alphanumeric
  • Does not require more letters

Browser other questions tagged

You are not signed in. Login or sign up in order to post.