We are currently building up our customer portal using Orchard 1.5 RC-1. Each customer is a tenant in an isolated database. All tenants are running on the same domain; we use the RequestUrlPrefix to separate clients.
When a customer arrives as the main site, e.g. customers.contoso.com and logs in, he will be redirected to customers.contoso.com/client1. The customer should also be able to perform user account self-service, i.e. changing/resetting password.
This makes me believe that we need a common database for user authentication and authorization, since the customer needs to log in before beeing redirected to the correct tenant.
My idea was to implement the IAuthenticationService, IMembershipService etc by wrapping the standard Orchard implementation and then inject the IContentManager for the
default tenant into these classes. In that way, all tenants would use the same repository for authentication and we would avoid problems with duplicate user data.
However, I struggle to find a way of injecting the IContentManager corresponding to the default tenant into the wrapped classes. Are there any repository of instantiated ContentManagers or would I need to create one from scratch, using e.g. information from
the IRunningShellTable? Or maybe the whole idea is bad?