Answer the question
In order to leave comments, you need to log in
How to make authorization in an application with multiple databases?
There was a task to remake the authorization system in the application.
Now the base of each organization is deployed on separate subdomains and it all looks like this
Now, everything needs to be redone to such a form that access to all bases was through one subdomain.
The question arises how to make a request to check the existence of a user in all databases during authorization? The number of bases is planned to be increased. A user can simultaneously be in several databases at the same time.
Answer the question
In order to leave comments, you need to log in
Create a custom implementation of the UserProvider contract , in which "make a request to check the existence of the user in all databases."
I would advise you to unite and transfer users to another database, if you have them and since they are shit. It will be much more elegant than it is now, especially since you are planning their growth.
By the way, apparently you now have an incorrect architecture that needs to be reworked, in your case there is a violation of normal forms.
According to the idea, you should have something like this
users - A table of all users organizations
- all companies you specify what role your user has in this particular organization, that is, the fields are user_id, organization_id, role_id
Well, etc., for example, let's take some other type of data, let it be services provided by an organization, then they will have a services table with an organization_id field and other fields
In general, everything is quite simply distributed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question