Reputation: 789
What is the best architectural approach for the use case example below:
As far I understand OAuth scopes are not applicable for use cases above. One way is to store all data (including permissions) in relational database and query it using joins every time. Another way is to have some external system like LDAP that is going to store relations between entities and manage their permissions. Entities itself are still stored in some database.
Both of options above do not look too attractive for obvious reasons. In the first case, you end up having too many joins. In the second case, you might have a hard time managing data integrity across two systems. Also, it violates single source of truth principle.
The use case must be typical for software development, but I have not found any "best practices" advice for this use case. I will appreciate any suggestions or references to external resources.
Upvotes: 1
Views: 344
Reputation: 13834
The best practice is to use externalized authorization management (EAM).
Externalized Authorization Management offers a more granular way to manage access within an organization. (Gartner)
EAM gives you:
In particular, ABAC provides you with an architecture which decouples the layer you want to protect (an app, data inside a database...) from the authorization logic. This means you can evolve your app independently of the authorization and vice versa. XACML is the de facto implementation for ABAC.
All your requirements end up being expressed as policies.
Upvotes: 1