NOTE: I posted the same question yesterday but with different explanation, now I am editing it completely and trying to explain my point from a different aspect.
I am trying to implement authentication process for a multi-tenant site where we will have different companies registered for example: company 1, company 2 and etc and each company will have multiple users like company 1 will have User1, User2 and so on.
Here, I am using separate database for each company due to some strong reasons. I want the user to visit the site and just authenticate himself without using any separate domain. There will be a different domain for each company (e.g company1.mysite.com), but the user will be redirected to his respective domain after login.
So, my question is, how can I authenticate each user from his respective database at the time of login?
Thank You