I have a couple of APIs("Group A and B") which call a single, central API ("API X"). All use authentication via Azure AD.
Within "API X", I want to restrict a couple of routes to a subset of the available routes.
/api/stuffForEveryOne/... <-- Group A and B should be able to call this
/api/specialStuff/... <-- Only Group B should be able to call this
What is the proper way to implement this?
My idea was to assign the AAD applications to AAD groups, and validate by querying graph API in "API X". But since there are no users this context, I am not sure if this is the correct way. Ideally, it would be great if "Group B" would get an additional claim when they request a JWT token for "API X". But I don't know if that is possible. "Group A" should not be able to get this claim.