asp.net mvc - How to change PasswordValidator in MVC6 or AspNet Core or IdentityCore -


in asp.net mvc 5 using identity, possible following:

 manager.passwordvalidator = new passwordvalidator             {                 requiredlength = 6,                 requirelowercase = true,                 requiredigit = false,                 requireuppercase = false             }; 

how change same configuration in mvc 6?

i see can in configurationservices method in segment:

 services.addidentity<applicationuser, identityrole>()          .addpasswordvalidator<>() 

but not use.

the solution beta6

in startup.cs write code:

          services.configureidentity(options =>             {                 options.password.requiredigit = false;                 options.password.requiredlength = 6;                 options.password.requirelowercase = false;                 options.password.requirenonletterordigit = false;                 options.password.requireuppercase = false;             }); 

update beta8 , rc1

            // add identity services services container.             services.addidentity<applicationuser, identityrole>(options =>                {                    options.password.requiredigit = false;                    options.password.requiredlength = 6;                    options.password.requirelowercase = false;                    options.password.requirenonletterordigit = false;                    options.password.requireuppercase = false;                })                 .addentityframeworkstores<applicationdbcontext>()                 .adddefaulttokenproviders(); 

update rc2

            // add identity services services container.             services.addidentity<applicationuser, identityrole>(options =>                {                    options.password.requiredigit = false;                    options.password.requiredlength = 6;                    options.password.requirelowercase = false;                    options.password.requirenonalphanumeric= false;                    options.password.requireuppercase = false;                })                 .addentityframeworkstores<applicationdbcontext>()                 .adddefaulttokenproviders(); 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -