✅ Help with authentication/authorization for my application with .net 7
Hi, I was hoping someone could help me out with Claims/Identity/Roles.
I have an application with a couple system users. These users pass an API Key along their requests. Through this api key, I find their actual user in a DB. In addition to the
User
User
table, I have a
Feature
Feature
table and a
UserFeature
UserFeature
table that connects a user with some feature of the application. This is how I can see that userA has access to the feature CustomerSearch for example.
I would like to move away from gnarly if-checks in the controller to see if a UserFeature entity exists with the userId, and instead make use of the annotations found in .net on the controller endpoints so that I can simply annotate that a method requires a certain feature. Any ideas?