I have two databases 'ApplicationDbContext' for Admin and 'TenantDbContext' for client users. But my client now wants a feature to access other portals through his user from ApplicationDbContext.
I tried adding two Identities in the DI container but it throws an error in runtime saying 'Scheme already exists: Identity.Application'
The code I used is below:
services.AddIdentity<TenantUser, IdentityRole>()
.AddEntityFrameworkStores<TenantDbContext>()
.AddDefaultTokenProviders();
services.AddIdentity<User, Data.Entities.ApplicationDbUsers.Role>(options =>
{
})
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
Is there any way I can add two identities in Ioc Container so that I users can be authorized from both the databases?