Once creating a ASP.NET MVC5 project (with target framework is .NET 4.5.1 and the authentication type is Individual User Account
This may arrive a bit late for you but I'll leave it in case anyone else runs into the same problem. So I finally managed to make Identity 2.0 and Oracle work together. The following steps work if you don't want to make any changes to the default IdentityUser (ex. if you're ok with having a char ID instead of int or long) and just want the tables on your existing Oracle schema.
Create Identity tables on Oracle. You can change the table names if you want to, just make sure to include the necessary columns for Identity to work with it. You can also add any extra columns you may need on your application (script originally found on Devart, I copied it to a gist in case URL breaks):
Gist here
If you're using an EDMX file, you need to add a new connection string cause the one that gets generated automatically won't work, you need a standard connection string. Try following this template:
Tell your ApplicationDbContext to use your new connectionString
public ApplicationDbContext()
: base("IdentityContext", throwIfV1Schema: false)
{
}
Tell Identity to use your existing schema and tables. Add this method inside the ApplicationDbContext definition found in IdentityModels.cs:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder); // MUST go first.
modelBuilder.HasDefaultSchema("YOUR_SCHEMA"); // Use uppercase!
modelBuilder.Entity().ToTable("AspNetUsers");
modelBuilder.Entity().ToTable("AspNetRoles");
modelBuilder.Entity().ToTable("AspNetUserRoles");
modelBuilder.Entity().ToTable("AspNetUserClaims");
modelBuilder.Entity().ToTable("AspNetUserLogins");
}
Rebuild and thats it!
Let me know if it works for you!