Right, so..I think I'm confused!!
I have a few ASP.NET MVC 5 sites running using ASP.NET Identity 2.1 and everything is great. I am creating a new MVC 6 site and I would like the users to use there existing credentials that they use for other systems. I have already tried the below:
I am just wondering what my options are since the documentation is not great on the new version, I get that there are DDL changes in the DB but I was kind of hoping there would be a way for my MVC 5 websites to carry on going as is with the .NET Identity 3 database being backwards compatible with 2.1.
My other option is to upgrade the MVC 5 apps to use Identity 3 which in turn I believe means updating them to MVC 6, which is something I don't really have the resources for, or to have a totally new Identity database (which seems the least fuss option).
Any opinions would be helpful, no doubt I have missed out some detail so happy to fill in the blanks should anyone have any further questions about the setup.
I was doing the same thing, its a good deal of effort - and you will have to run db migrations, but first
The new ASP Identity V3 Tables & Migration
The new ASP Identity V3 Fields
Configuring the tables In Startup.cs and change services.AddIdentity
services.AddIdentity<ApplicationUser, IdentityRole<int>>()
.AddEntityFrameworkStores<ApplicationDbContext, int>()
.AddDefaultTokenProviders();
In ApplicationContext.cs and change the class to the following signature.
public class ApplicationDbContext : IdentityDbContext<ApplicationUser, IdentityRole<int>, int>
In ApplicationUser.cs and change the class to the following signature.
`public class ApplicationUser : IdentityUser<int> {...}`
dotnet
ef migrations add MyDatabaseHere -o Data\Migrations
. (-o Option is to specify target folder and not root folder)I got two migration scripts from EF, I was not sure why... but for more references from github links 1 & 2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With