首页 > 技术文章 > .net core Identity注册用户 出错

zhangmm96 2019-07-10 19:23 原文

使用微软自带的注册 报 NotSupportedException: No IUserTwoFactorTokenProvider<TUser> named 'Default' is registered.

是因为startup缺少配置文件

注册下面蓝色背景服务

services.AddIdentity<ApplicationUser, IdentityRole>(options =>
{
options.Password.RequireNonAlphanumeric = false;
options.Password.RequiredLength = 1;
options.Password.RequireLowercase = false;
options.Password.RequireUppercase = false;
})
.AddDefaultUI(UIFramework.Bootstrap4)
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();

 

推荐阅读