Skip to main content

I don't know, how to remove/disable default AspNetCore.Identity.UserValidator. UserManager has 2 UserValidators now: Microsoft.AspNetCore.Identity.UserValidator and Penize_eShop.MyUserValidator

Thanks for help

enter image description here

 public void ConfigureServices(IServiceCollection services)  {   // Add framework services.   services.AddApplicationInsightsTelemetry(Configuration);   services.AddDbContext<ApplicationDbContext>(options =>   options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));   services.AddIdentity<MyUser, MyRole>(options =>   {   options.Password.RequiredLength = 6;   options.Password.RequireDigit = false;   options.Password.RequireLowercase = false;   options.Password.RequireUppercase = false;   options.Password.RequireNonAlphanumeric = false;   })   .AddEntityFrameworkStores<ApplicationDbContext>()   .AddUserStore<MyUserStore>()   .AddUserManager<MyUserManager>()   .AddRoleManager<MyRoleManager>()   .AddErrorDescriber<MyErrorDescriber>()   .AddDefaultTokenProviders()   .AddUserValidator<MyUserValidator<MyUser>>()   ;   services.AddScoped<SignInManager<MyUser>, MySignInManager>();   services.AddScoped<IPasswordHasher<MyUser>, MyPasswordHasher>();     services.AddMvc();   // Add application services.   services.AddTransient<IEmailSender, AuthMessageSender>();   services.AddTransient<ISmsSender, AuthMessageSender>();  } 

I don't know, how to remove/disable default AspNetCore.Identity.UserValidator. UserManager has 2 UserValidators now: Microsoft.AspNetCore.Identity.UserValidator and Penize_eShop.MyUserValidator

Thanks for help

enter image description here

 public void ConfigureServices(IServiceCollection services)  {   // Add framework services.   services.AddApplicationInsightsTelemetry(Configuration);   services.AddDbContext<ApplicationDbContext>(options =>   options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));   services.AddIdentity<MyUser, MyRole>(options =>   {   options.Password.RequiredLength = 6;   options.Password.RequireDigit = false;   options.Password.RequireLowercase = false;   options.Password.RequireUppercase = false;   options.Password.RequireNonAlphanumeric = false;   })   .AddEntityFrameworkStores<ApplicationDbContext>()   .AddUserStore<MyUserStore>()   .AddUserManager<MyUserManager>()   .AddRoleManager<MyRoleManager>()   .AddErrorDescriber<MyErrorDescriber>()   .AddDefaultTokenProviders()   .AddUserValidator<MyUserValidator<MyUser>>()   ;   services.AddScoped<SignInManager<MyUser>, MySignInManager>();   services.AddScoped<IPasswordHasher<MyUser>, MyPasswordHasher>();     services.AddMvc();   // Add application services.   services.AddTransient<IEmailSender, AuthMessageSender>();   services.AddTransient<ISmsSender, AuthMessageSender>();  } 

I don't know, how to remove/disable default AspNetCore.Identity.UserValidator. UserManager has 2 UserValidators now: Microsoft.AspNetCore.Identity.UserValidator and Penize_eShop.MyUserValidator

Thanks for help

enter image description here

public void ConfigureServices(IServiceCollection services) { // Add framework services. services.AddApplicationInsightsTelemetry(Configuration); services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); services.AddIdentity<MyUser, MyRole>(options => { options.Password.RequiredLength = 6; options.Password.RequireDigit = false; options.Password.RequireLowercase = false; options.Password.RequireUppercase = false; options.Password.RequireNonAlphanumeric = false; }) .AddEntityFrameworkStores<ApplicationDbContext>() .AddUserStore<MyUserStore>() .AddUserManager<MyUserManager>() .AddRoleManager<MyRoleManager>() .AddErrorDescriber<MyErrorDescriber>() .AddDefaultTokenProviders() .AddUserValidator<MyUserValidator<MyUser>>() ; services.AddScoped<SignInManager<MyUser>, MySignInManager>(); services.AddScoped<IPasswordHasher<MyUser>, MyPasswordHasher>(); services.AddMvc(); // Add application services. services.AddTransient<IEmailSender, AuthMessageSender>(); services.AddTransient<ISmsSender, AuthMessageSender>(); } 
Source Link

How to remove default UserValidator

I don't know, how to remove/disable default AspNetCore.Identity.UserValidator. UserManager has 2 UserValidators now: Microsoft.AspNetCore.Identity.UserValidator and Penize_eShop.MyUserValidator

Thanks for help

enter image description here

 public void ConfigureServices(IServiceCollection services) { // Add framework services. services.AddApplicationInsightsTelemetry(Configuration); services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); services.AddIdentity<MyUser, MyRole>(options => { options.Password.RequiredLength = 6; options.Password.RequireDigit = false; options.Password.RequireLowercase = false; options.Password.RequireUppercase = false; options.Password.RequireNonAlphanumeric = false; }) .AddEntityFrameworkStores<ApplicationDbContext>() .AddUserStore<MyUserStore>() .AddUserManager<MyUserManager>() .AddRoleManager<MyRoleManager>() .AddErrorDescriber<MyErrorDescriber>() .AddDefaultTokenProviders() .AddUserValidator<MyUserValidator<MyUser>>() ; services.AddScoped<SignInManager<MyUser>, MySignInManager>(); services.AddScoped<IPasswordHasher<MyUser>, MyPasswordHasher>(); services.AddMvc(); // Add application services. services.AddTransient<IEmailSender, AuthMessageSender>(); services.AddTransient<ISmsSender, AuthMessageSender>(); }