How to setup auth0 users that can have 1 to many companies

Hello,

My client has 2 applications (react SPAs + node apis). For the second application we have used auth0 to store our users. Now I am needing to migrate the first applications users to auth0, which is no problem.

My issue is the users can be associated to one or many companies. I’m trying to figure out the best way to handle this. My initial solutions are

  1. use auth0 organizations - this seemed overkill to me
  2. use authorization extension and groups - this didn’t seem like the right tool to me. groups seemed more like groups of users under a single company.
  3. have a separate DB that housed the companies and which companies were tied to which users.
  4. tying users to companies through user metadata - this sort of made sense to me, but I’m unsure how I would store company metadata like company name.

I guess I am kind of leaning towards #3 with a separate DB and probably a separate API to manage that DB that can be used by both applications.

Is there an approach or auth0 tool I am missing? Or is this a common approach for this situation.

Thank you very much

Hey there @llai !

My initial response to a set up like this is to use Organizations - If you haven’t already, I definitely recommend taking a look at our Architecture Scenarios documentation, and in particular Multiple Organization Architecture:

Hope this helps!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.