I think what you started in your question, this is your best choice.
It is best to have one user table and three configuration tables. One user table will be associated with single sign-on functionality, which will check users, their general profile and account information. Each service / website is not related to a domain that uses a federated SSO that validates user cookies. That is, pretend that everything was the same, except that you use google web federation for SSO. The data stored in google does not really bother you (except, maybe there are fields that you do, maybe a username, etc.). No matter which domain you are in, the first thing you do is call the SSO, and see if the user is already registered, if they do not direct them there, and when they are done, they will be redirected back to your subdomain.
If they are logged in, then do not redirect, but you get a jwt token that will allow you to convert the stored user identifiers (or UIDs) into actual information.
Say the registered user is buying something from fashion.example.com. You can add a row to the order table that has a column named "userId". If this site wants to publish "user X ordered Y" on the first page, after receiving the order from the table, you must call the single sign-on service to return jwt with user information using the SSO token. If for some reason you wanted to save a configuration that is different from the subdomain, then this subdomain will create its own "users" or "configuration" table, and the key will be associated with the UID in the single sign-on service. Regardless of whether you have a unique PK (from FX to UID) or if PK is a UID.
This will allow you to completely separate the domains from each other. And let your subdomain decide if they need a "users" table or not.
TL; DR. You really have 4 domains, not 3, consider it as 1 SSO authentication domain and 3 sites. SSO will have an auth table, and each site domain may or may not have its own user table, if necessary. This user table will have an FK in the SSO table without the need for forced FX restrictions. (The FK restriction, if it can be enforced in some way, would actually be bad because you would not want to use the single sign-on service to know about the subdomains when the user account should be deleted, the fact that they are all different, the database is already awesome.)
Warren parad
source share