示例
//Enable Identity in this project
services.AddIdentity<ApplicationUser, ApplicationRole>(options =>
{
options.Password.RequiredLength = 5;
options.Password.RequireNonAlphanumeric = false;
options.Password.RequireUppercase = false;
options.Password.RequireLowercase = true;
options.Password.RequireDigit = false;
options.Password.RequiredUniqueChars = 3;
}).AddEntityFrameworkStores<ApplicationDbContext>().AddDefaultTokenProviders().AddUserStore<UserStore<ApplicationUser, ApplicationRole, ApplicationDbContext,
Guid>>().AddRoleStore<RoleStore<ApplicationRole,ApplicationDbContext,Guid>>();
Gitee获取源码: