-
-
Couldn't load subscription status.
- Fork 90
Description
I am incredibly interested in what you have built with the Id Server.
Today I'm working on standing up and creating an Identity Server with there QuickStart UI that I'm slowly adding onto. I looked into your solution but there is no good way today to quickly add multitenancy support to TheIdServer that I can see, at least not by using your templates. I attempted to pull your entire code base down to see if I could get it to run but I failed for many hours.
Today I'm using Finbuckle for multitenancy on Identity servers which is very easy to setup. I have it configured for each tenant to have its own database and I have a seed script for each of those databases. By AspNetCore Entity framework context along with the persistentgrant context and Configuration context are all configured for multitenant support with IdentityServer.
My default tenant falls back to a certain Database if one is not entered but my pathing assumes that https://myUrl.com/TenantId/whateverExistingPathHere. and then i use a simple middleware to get my tenant for that request and then process to the page
app.UseMultiTenant();
app.Use(async (context, next) =>
{
var multiTenantContext = context.GetMultiTenantContext<ExtendedTenantInfo>();
var tenant = multiTenantContext?.TenantInfo;
if (tenant != null && multiTenantContext?.StrategyInfo?.StrategyType == typeof(BasePathStrategy))
{
context.Request.Path.StartsWithSegments("/" + tenant.Identifier, out var matched, out var newPath);
context.Request.PathBase = Path.Join(context.Request.PathBase, matched);
context.Request.Path = newPath;
}
await next.Invoke();
});I'd like to do the same with TheIdServer and see how this works for me. The idea I had is that eventually I'd have a tenant drop down on the blazer app to select my tenant and work from that tenant but it would always default to my primary like i have it now.
Would you be able to guide me on the different things I might have to override in TheIdServer to potentially accomplish this?
If successful I'd be willing to open a PR back into your repo with it setup to provide optional multiTenant configurations for other users of TheIdServer.