Program cs - 2023 App Security

PHOTO EMBED

Mon Jun 17 2024 08:45:49 GMT+0000 (Coordinated Universal Time)

Saved by @iamkatmakhafola

//Password and Email
builder.Services.AddIdentity<AppUser, IdentityRole>(options =>
{
    options.User.RequireUniqueEmail = true;
    options.Password.RequireNonAlphanumeric = true;
    options.Password.RequiredLength = 12;
    options.Password.RequireDigit = true;
    options.Password.RequireUppercase = true;
})
.AddEntityFrameworkStores<AppDbContext>()
.AddDefaultTokenProviders();
content_copyCOPY

2023 - Configurations: 1.1 In the “Program.cs” file: a) Add configurations to make sure the application does not allow for duplicate email accounts. Further all passwords should be 12 characters or more, have a digit in it, have an uppercase character and contain a non-alphanumeric character.