I have a service providing an API running in Google Cloud behind IAP. The authentication is working as expected to allow users access to the API.
In order to lock down the API on a more granular level I would like to allow access to certain paths based on what IAM roles the user has within the Google project.
I thought I could use one of the Google rest APIs to get the list of roles given the user ID that comes through in the header from IAP (or finding a way to decorate the request with role information), but I am failing to find out what scopes I need or which API to use.
Does anyone know how to do something similar?