Hi.
I'm working on a web portal hosting several "modules", each of those module having their subset of users. Multitenancy is a well known topic and I can find resources around that, this one for instance: http://www.charlesnurse.com/Blog/Post/1595/Naif-Blog-6-Using-Middleware-to-Implement-Multi-tenancy
But I always end up being stuck by a lack of flexibility in the usage of the authentication middleware packaged with asp.net core right now.
Let me explain: using DI I could easily create for each request an application context that would be handling dynamically at runtime a list of module, I could add a module, and my application context could be plugged on this newly created module at runtime. But when it comes to authentication, I can't find a way to create an authentication cookie whose name wouldn't need to be fixed when creating the application, I can't either add a new authentication middleware at runtime(https://github.com/aspnet/Security/issues/1132) that would be in charge of authenticating user for this new module, so I end up being stuck. Basically, I cannnot add a layer of authentication for a newly created module at runtime.
Am I mistaken? Do you see how this could be achieved?
Thanks.