I've created a fresh .net Core 3.1 solution with ASP.net Identity.
The Register page requires a minimum of 6 characters.
I want to configure these requirements thus
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<IdentityOptions>(options =>
{
options.Password.RequiredLength = 1;
options.Password.RequireUppercase = true;
options.Password.RequireLowercase = true;
options.Password.RequireDigit = false;
options.Password.RequireNonAlphanumeric = false;
options.Password.RequiredUniqueChars = 5;
});
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddEntityFrameworkStores<ApplicationDbContext>();
services.AddControllersWithViews();
services.AddRazorPages();
}
I've added the password options at the top there, but they are being ignored. 6 to 100 characters are still required to be entered when registering.
Saying this should work. There isn't even an error so not sure how to problem solve this.
How can I get this working? Thanks.

AddDefaultIdentitythenConfigure<IdentityOptions>. If that doesn't work, maybe try toAddDbContextbefore these 2. This is a nice link.