Replies: 5 comments
-
Hi @sskhokhar no worries at all :) having a public discussion about comprehensive user scenario would also benefit community.
I think different login approaches can be handled by multiple login endpoints, an example would be the passport-login. Multiple users doesn't matter IMO. When you decode the user information from e.g. a token, the authentication system passes a very flexible user profile object(it supports any users) to the authorization system to make the access decisions.
Example of access control would be a good reference. That repository only has one user model specified with different roles, but in your case, you can treat different users as different roles. Remember the authorization system only collects user information, e.g. is it an admin, or buyer, or seller, it doesn't care how the abstractions of those information are created. |
Beta Was this translation helpful? Give feedback.
-
@jannyHou Thank you for reply. I appreciate it I have tried to use the authentication component, but the problem is token service only takes email, password and security id to generate token i.e "UserProfile" interface. To bypass this barricade. I was thinking to do following: UserService: UserController: What do you say about this? |
Beta Was this translation helpful? Give feedback.
-
@jannyHou This is the architecture i came up with. Let me know if you’re confused |
Beta Was this translation helpful? Give feedback.
-
@sskhokhar |
Beta Was this translation helpful? Give feedback.
-
Did you ever resolve the issue? How would this work in a multi-tenant case where there is a a single common database? |
Beta Was this translation helpful? Give feedback.
-
Hi all,
First sorry to post here, I have asked on slack but no one answered.
I need help in designing authentication and authorization mechanism in LB4
I have following entities:
1- Administrator (login with email and password)
2- Buyer (login with phone number only - verified by OTP)
3- Seller (login with phone number only - verified by OTP)
4- Support Assistant (login with phone and Password)
What would be the best way to do that? I cant create a single model for Users because every user entity has different relations with different models.
Beta Was this translation helpful? Give feedback.
All reactions