As I am working on a new platform (.net core 3 API) where every company has a separate database. I'm finding myself with an issue I can't find a solution to on the internet.
Companies have different users, but users should be able to login on different companies if they have the right to. Having a master database with all companies/users would work but then I would lose the foreign keys to the users? How is this issue solved by best practices?
I'm not talking about SQL users but users that are created on our application.