问题
NotSupportedException: No IUserTwoFactorTokenProvider named ‘Default’ is registered.
原因:startup文件缺少配置
在 public void ConfigureServices(IServiceCollection services)方法中添加如下配置
ervices.AddIdentity<IdentityUser, IdentityRole>(options =>
{
services.AddIdentity<ApplicationUser, IdentityRole>(options =>
{
options.Password = new PasswordOptions()
{
RequireNonAlphanumeric = false,
RequireUppercase = false
};
}).AddEntityFrameworkStores<ApplicationDbContext>().AddDefaultTokenProviders();