Hello Haibert Barfian,
Thanks for posting!
Since you are using client credentials auth flow, so you need to consent required application permissions to run this endpoint. In your case you require atleast DeviceManagementServiceConfig.Read.All application permission in your Azure AD application to List windowsAutopilotDeviceIdentities, which is missing in Graph API permissions screenshot you shared.
Refer below for details regarding permissions and access scenarios.
Authentication and authorization basics - Microsoft Graph | Microsoft Learn
Microsoft Graph permissions reference - Microsoft Graph | Microsoft Learn
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".
Correct Authentication Flow for Backend Graph API Calls
Haibert Barfian
40
Reputation points
Hi there,
I am using node js and Graph API end points. my authentication method is client Secret.
I need to access Graph APIs such as List Devices
I keep getting an not authenticated error.
here are my permissions.
Microsoft Security Microsoft Graph
13,721 questions
Accepted answer
-
HarmeetSingh7172 4,826 Reputation points
2023-04-06T21:07:47.9666667+00:00