filmov
tv
ASP NET core identity password complexity

Показать описание
Text version of the video
Healthy diet is very important for both body and mind. We want to inspire you to cook and eat healthy. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking.
Slides
ASP.NET Core Text Articles & Slides
ASP.NET Core Tutorial
Angular, JavaScript, jQuery, Dot Net & SQL Playlists
ASP.NET Core Identity Password Default Settings
public class PasswordOptions
{
public int RequiredLength { get; set; } = 6;
public int RequiredUniqueChars { get; set; } = 1;
public bool RequireNonAlphanumeric { get; set; } = true;
public bool RequireLowercase { get; set; } = true;
public bool RequireUppercase { get; set; } = true;
public bool RequireDigit { get; set; } = true;
}
We could do this by, using the Configure() method of the IServiceCollection interface in the ConfigureServices() method of the Startup class
services.Configure[IdentityOptions](options =]
{
options.Password.RequiredLength = 10;
options.Password.RequiredUniqueChars = 3;
options.Password.RequireNonAlphanumeric = false;
});
OR
We could also do this while adding Identity services
services.AddIdentity[IdentityUser, IdentityRole](options =]
{
options.Password.RequiredLength = 10;
options.Password.RequiredUniqueChars = 3;
options.Password.RequireNonAlphanumeric = false;
})
.AddEntityFrameworkStores[AppDbContext]();
ASP.NET Core IdentityOptions
In this example, we are using the IdentityOptions object to configure PasswordOptions. We could also use this IdentityOptions object to configure
UserOptions
SignInOptions
LockoutOptions
TokenOptions
StoreOptions
ClaimsIdentityOptions
Комментарии