Last post Oct 09, 2019 10:31 AM by jiadongm
Oct 08, 2019 06:25 PM|Norkle|LINK
I see blogs and articles around the 'net on integrating aspnet Identity or OWIN to an existing MVC 5 project, but they are very vague or they show how to also implement the MIgration integration that builds the AspNetRoles and AspNetUsers* tables. I already
hav those tables in my database from an earlier project, i just need to find out how to properly integrate the nuget packages and then the other dbcontext configurations involved to allow password protection to existing project.
Thanks in advance
Oct 08, 2019 06:57 PM|mgebhard|LINK
Your question is not clear. Are you trying to connect to an existing database that has Identity tables?
Oct 08, 2019 07:20 PM|Norkle|LINK
I'm trying to add all the ASpnet Identity components to an existing MVC5 project in visual studio 2017. I already have the database tables for aspnet identity inside my database.
Oct 09, 2019 10:31 AM|jiadongm|LINK
First you should install the Identity packages with NuGet.
Make your user class inherit IdentityUser, make role class inherit IdentityRole, modify columns’ names to keep consist with the Identity original tables. Also you can add some columns as an extension
Change your DbContext parent from DbContext to IdentityDbContext
Extend UserManager if you have your own configuration and customization
Configure OWIN in your project
Set OWIN in web.config
This is my summary. For more details, you can refer to: