Graph API - Insufficient privileges to complete the operation

前端 未结 9 1395
长情又很酷
长情又很酷 2020-12-09 01:37

When trying to access the Graph Service Client using I am receiving the error :

Code: Authorization_RequestDenied
Message: Insufficient privile

9条回答
  •  遥遥无期
    2020-12-09 02:20

    Please refer to below steps :

    1. From your screenshot , seems you grant Read and write directory data application permission for Windows Azure Active Directory(azure ad graph api) . Since you are using microsoft graph (https://graph.microsoft.com/) , you need to grant application permission for Microsoft Graph :

    2. Since you are admin in your AAD, You could grant permission for users in organization by click Grant permission button shown in above screenshot .

    3. Then you could use your code (client credential flow to get the token) and query users information . If you check the claims in access token issued by azure ad , you could find Directory.Read.All permission in roles claim .

提交回复
热议问题