I have developed my first application using ASP.NET Core MVC 5.0.
There was a database already existing but I implemented full database in new program and now the issue was ASP.NET Core identity. So for identity I scaffolded as per instructions and finally implemented default identity authentication using email and pass.
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = false)
.AddRoles<IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>();
In startup.cs
and after that I have a model with existing field i.e. cardno, phone and want to authenticate them on this. In PHP it was really very easy using $_SESSION
variable. But now in here I want this to happen in ASP.NET any help will be appreciated.
services.AddIdentity<CnicUser, IdentityRole>().AddEntityFrameworkStores<ApplicationDbContext>();
This code I added for my custom authentication I got this error
Application startup exception System.InvalidOperationException: Scheme already exists: Identity.Application at Microsoft.AspNetCore.Authentication.AuthenticationOptions.AddScheme(String name, Action`1 configureBuilder)