here it goes
Im building a small saas product and im using couple of libraries in my system.
Libraries
Aauth (for authentication)
When a user register in the app a new account will be generated to him/her using email address used and credentials provided. System will open an account and generate new authentication account (User name and Password).
NO ISSUE UP TO HERE.
summary of my problem is as follows:
assuming there are Account A and B which belong to two different customers and Account A has 3 users and Account B has 2 users. Aauth library supports unique email address as the login.
How to allow user from Account A register in Account B with out issues.
i need answer from architecture point of view. How would you go about it ?
Solution i thought
Add new column in user table (will not work Aauth uses the email as the unique identifier and if i want to implement this it will require alot of source code modification).
Change the auth library to Ion_auth. Its simpler to modify and less features but still contains groups.
Make a new copy of the system for every new account (Its just not feasible in case of update or identifying an issue)
Create new DB for every single account (Again same as above)
Build my own auth library with simpler concepts and is as follows:
DB Schema
tbl_Accounts
id
name
tblt_users
id
email
password
account_id
tbl_groups
id
group_name
The issue with this solution is is solves the complexity of the schema but does not solve that users can register to a different accounts. Please suggest a better schema to solve my requirements.
Notes
This post gave me some things to consider in my design.
If my explanations is weak or require further editing please comment im happy to elaborate further or enhance the writing, Thank you