I am developing a multi-tenanted asp.net application and want to know if the following is a viable way to simplify the login process.
I want to give each account its own unique address, e.g. http://www.website.com/customer1, http://www.website.com/customer2, http://www.website.com/customer3, etc.
The customer1 folder doesn’t exist and the 404 handler page would deduce the account from the customer1 part of the address. It would then display a standard login page but can then also include the customer’s logo and custom content and would also know that it must check the user name only against accounts linked to the account for customer1 when a log in is attempted.
My proposed process is a hack and I want to know if there is a more elegant way to accomplish this.
I prefer sub-domains to identify the tenants. You can then key things off of that while using the same underlying codebase and no pesky virtual directory folders per tenant:
It is also easier to scale later with this approach. If you need sub-domains 1-100 to run on server A, it’s an simple DNS/Load Balancer…or whatever you are using to direct traffic change.
Note on Routing: It’s great for your application, but do you want to alter routing rules every-time you add a client?