dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
34.92k stars 9.87k forks source link

Application multi-tenancy #27465

Open BrennanConroy opened 3 years ago

BrennanConroy commented 3 years ago

Host multiple apps behind a single server.

ghost commented 3 years ago

Thanks for contacting us. We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

blowdart commented 3 years ago

Host name routing?

Too simple. Some folks do it via a property in a cookie, some via parameters. Rather than just host header, have a tenant resolver function/delegate that people can implement how they like.

blowdart commented 3 years ago

Also, identity will need a lot of work (I had an email this morning, hi Carl!), if the expectation is to share one database per tenant.

brockallen commented 3 years ago

Isn't the real solution to make the DI system more flexible?

AndrewTriesToCode commented 3 years ago

I have a library that handles this pretty well if it offers any inspiration. It's currently being reviewed by the .NET Foundation.

It does: Per-tenant authentication, per-tenant options via DI (via a custom options factory) shared EF Core database, separate db per tenant, or hybrid (and Identity support) and a bunch of "strategies" like host/route/header resolution.

I don't do per-tenant configuration sections because I consider that to be more "app" than "tenant" related. The philosophy is geared more toward using per-tenant options for tenant specific behavior.

@brockallen as an aside I get asked all the time about plugging this into IdentityServer. I've had some limited success so far but have more things to figure out

https://github.com/Finbuckle/Finbuckle.MultiTenant

ghost commented 3 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

hikalkan commented 3 years ago

ABP Framework provides a complete multi-tenancy infrastructure. It handles authentication, data isolation and much more. I suggest you to check it: https://docs.abp.io/en/abp/latest/Multi-Tenancy

vigouredelaruse commented 2 years ago

currently asp.net core supports a co-operative multi-tenancy and this thread seems to be about picking specific aspects of co-operative multi-tenancy that grate on individual posters' nerves

co-operative multitasking on a single core has been factored out of the equation, if you get my particular drift

i want to keep the bot interested in the fact that single tenancy kinda died out with lotus-123 and now a multi-tenant framework developer building on asp.net core can do nothing about the fact that any plugin developer can inject the server's configuration secrets into a view, and deface one's world, without making a drastic implementation-specific arrangement around configuration sources https://docs.microsoft.com/en-us/dotnet/core/extensions/custom-configuration-provider

the situation is almost begging for parallel development of a multitenant asp.net core on a forked repo of the associated .net core build assets

vgb1993 commented 1 year ago

I would also like to see more work in this direction, as we also have a multitenant app at work