Correct Authentication Flow for Backend Graph API Calls

Haibert Barfian 40 Reputation points
2023-04-06T20:22:48.5433333+00:00

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. 1

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. HarmeetSingh7172 4,826 Reputation points
    2023-04-06T21:07:47.9666667+00:00

    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".

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.