Reputation: 13
I am working with asp.net core mvc application in which, when I have created project at that time I have choosen no authentication as authentication type. but now I need to use individual authentication for standard functionalities like register, login, forgot password, email verification and all.
problem is I have completed half of development and can't start now from beginning. so need to change authentication type in my existing project.
is there any way to update authentication in existing .net core application.
Upvotes: 1
Views: 4306
Reputation: 20126
You could refer to Scaffold identity into an MVC project without existing authorization to add Identity.
Remember to add migrations and call app.UseAuthentication()
from your Configure
. method.
If you have your dbContext already, modify it to inherit IdentityDbContext<IdentityUser>
and choose it when you do scaffolding instead of creating a new Data context class..
public class ApplicationDbContext : IdentityDbContext<IdentityUser>
Upvotes: 2