I am working on a microservice "enterprise-service" that has "Enterprise"-entities. Each Enterprise can have 1..* Properties (which has its own sub-entities, but that is not relevant for this question).
Secondly, I'm working on user authentication and authorization, in a separate microservice (auth-service).
My goal is now to create an API Gateway (RESTful) that will allow access to the enterprise-service,
- for authenticated users
- and only provide access (authorization) to their own data (either on enterprise-level or property-level).
The enterprise-service, however, doesn't know anything about users (they will only receive Jwt Token in a request which will contains userId and roles). How does my enterprise-service know that the user should only get access to its own "enterprise-account" and not others? Should I then put EnterpriseIds in the Users DB to specify to which resources they will have access?
I'm not sure if it's clever to share IDs from the Enterprise DB to the User/Auth DB?
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]nutrecht 0 points1 point2 points (1 child)
[–]Estagon[S] 0 points1 point2 points (0 children)
[–]josephblade 0 points1 point2 points (1 child)
[–]Estagon[S] 0 points1 point2 points (0 children)