Graph API - Forbidden / Unauthorized operation despite the correct permissions

Leonard RADECKI 0 Reputation points
2023-07-23T19:41:31.9366667+00:00

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 :

User's image

User's image

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/) :
User's image

However when I make my request I get (screenshot from Postman) :

User's image

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/) :
User's image

Still get the same response ("code": "Forbidden")

Thanks for your help,

Leonard.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,445 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 100.2K Reputation points MVP
    2023-07-24T16:14:52.06+00:00

    It looks like you need both DeviceManagementManagedDevices.Read.All and DeviceManagementConfiguration.Read.All for this query.