Auth0 Home Blog Docs

Auth0 Implementation for Multiple Sites

Hi.

I am creating 2 websites, each have their own user database.
What I’m trying to do is allow registered users on Site A to able to login to Site B without manually
registering them to it.

So far what I have done:
*Site A user logs in. User exist in Site A userDB, save to Auth0 DB.

What I’m trying to solve is:
*Site A user logs in to Site B. Site A user does not exist in Site B userDB but exist in my Auth0 DB, save Site A user details to Site B userDB.

I was thinking of making an xref table. Will contain User Id (from site) and user_id (from auth0), then will call an api from Site A to retrieve the user details there and save it to Site B userDB or vice versa.
The problem here is I have columns with foreign keys in user table that might not exist on the other site DB. Also, user in Site A may have different permission sets that exists in both sides.

Any advice/idea best way to implement this?