It looks like you need both DeviceManagementManagedDevices.Read.All and DeviceManagementConfiguration.Read.All for this query.
Graph API - Forbidden / Unauthorized operation despite the correct permissions
Hi,
I would like to list "malwareStateForWindowsDevices" using an Application context according to API Documentation : https://learn.microsoft.com/en-us/graph/api/intune-devices-malwarestateforwindowsdevice-list?view=graph-rest-1.0
As specified, my application has the permission "DeviceManagementManagedDevices.Read.All" needed :
The type is "Application" and not "Delegated" as it should be. The permission is granted.
Just to be sure, my token is valid as expected when I request it (checking with https://jwt.ms/) :
However when I make my request I get (screenshot from Postman) :
It's not the case when I use other resources with the same permission. Indeed, I can list "detectedApps" : https://learn.microsoft.com/en-us/graph/api/intune-devices-detectedapp-list?view=graph-rest-1.0&tabs=http that needs the exact same "DeviceManagementManagedDevices.Read.All" permission.
EDIT : I add the permission "DeviceManagementConfiguration.Read.All" (checking with https://jwt.ms/) :
Still get the same response ("code": "Forbidden")
Thanks for your help,
Leonard.