ASP.NET Identity OWIN with Entity Framework adds the following tables to the database:
ASPNetUsers
ASPNeRoles
ASPNeTokens
ASPNetUserClaims
ASPNetUserLogins
ASPNetUserManagements
ASPNetUserRoles
ASPNetUserSecrets
Can someone explain to me where these names come from? I scoured my solution and project files and see no reference to them. Are these names customizable (I mean when they're generated--not after they exist in the database)?
I tried an experiment and added a new project to my ASP.NET MVC 5 solution. I then used NuGet to install Microsoft ASP.NET Identity Owin. I then added Entity Framework 6 to that project and created a datacontext class that inherits from DbContext. At that point, I ran the "enable-migrations" command from the Package Manager Console. That created a Migrations folder and a migration class as well as a Configuration.cs class. So far, so good. But when I ran the "add-migration initial" command, none of the ASP.NET Identity tables mentioned above are generated.
Yet when I follow the same steps in my MVC project, however, the add-migration command does generate the above tables. In my MVC project, there is a startup.auth.cs class in my App_Start folder, however. That seems to be the key but I'm just not sure because something is "auto-magically" happening that I clearly don't understand. The startup.auth.cs file looks like this:
.
using Microsoft.AspNet.Identity;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Owin;
namespace AspNetIdentity
{
public partial class Startup
{
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
public void ConfigureAuth(IAppBuilder app)
{
// Enable the application to use a cookie to store information for the signed in user
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login")
});
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
}
}
}
If I want to be able to migrate the ASP.NET Identity tables from a project other than my MVC project, how can I do that?