I'm currently adding ASP.NET Core Identity with IdentityServer4.
I've added the identity similar to the line below.
services.AddDbContext<PublicApplicationDbContext>(options =>
options.UseSqlServer(
connection))
.AddIdentity<PublicIdentityUser, PublicIdentityRole>(opts =>
{
opts.Password.RequiredLength = 6;
})
.AddDefaultTokenProviders()
.AddEntityFrameworkStores<PublicApplicationDbContext>();
I wanted to a similar repository so I created a separate set of internal objects like InternalApplicationDbContext, InternalIdentityUser. I thought it would be as easy as configuring the steps above and injecting this...
UserManager<InternalIdentityUser>
However, it doesn't seem to work and I get an error similar to this. Scheme already exists https://github.com/aspnet/AspNetCore.Docs/issues/8223
I've read some documentation related to this but nothing implies it supports more than one identity provider. Is this the case or am I missing something?
To summarize, I want two separate databases to manage users, one for public users and another for internal ones. I want to use the built-in identity API UserManager to encapsulate the implementation as I honestly don't want to build my own.