it seems to me that the only way to achieve this is via portal delegation where we can take ownership of login and subscribe where we can then access the information programmatically. I don't see any api management sdk or feature that allows programmatic access to user, groups and subscription keys.
reverse lookup of subscription key
I need to access the group information of an api caller who has a subscription key for api management. I would like to be able to modify the header through policies and add the group info to the header. my backend api will use this information for enforcing row level security on the data being queried.
all I have when the caller makes the request is their subscription key so I would need to do the lookup and insert through group policies. is there a way I can access group info for the caller through api management policies?
2 answers
Sort by: Most helpful
-
-
ChaitanyaNaykodi-MSFT 22,776 Reputation points Microsoft Employee
2021-03-08T18:03:04.453+00:00 Hello @Wayne Theron , apologies for the delay. I think the requirement can be satisfied using the Context variable. You can get the association of an user to a group using context.User.Groups then use the Set HTTP header policy to modify the header. To programmatically access the user, groups and subscription please go through this REST API for API management.
You can refer to this question here for implementation. Please let me know if there are any additional concerns. Thank you!