MS-Graph request: insufficient privileges

大兔子大兔子 提交于 2020-05-17 06:27:06

问题


I'm having an issue with my .net core daemon-application recently. This worked fine at least a couple of days ago.

My request goes to https://graph.microsoft.com/v1.0/users:

var user = await client.Users[userPrincipalName]
                .Request()
                .Select("displayName,givenName,mail,mobilePhone,surname,userPrincipalName,id,onPremisesSecurityIdentifier,onPremisesDomainName,onPremisesSamAccountName")
                .GetAsync();

and returns the following error:

{
  "error": {
    "code": "Authorization_RequestDenied",
    "message": "Insufficient privileges to complete the operation.",
    "innerError": {
      "request-id": "482eac1f-5a38-429a-a0cb-bf5a47ae4b27",
      "date": "2020-04-28T11:31:33"
    }
  }
}

I tried resetting the API permissions in Azure, ensuring User.Read.All permission, revoking/removing/granting admin consent and resetting the token secret, all to no avail. When using Graph Explorer with my personal account (and thus using delegated permissions instead of application permissions), everything works fine.

Is this a Graph-Api-Problem? Am I doing something wrong? It seems others are having this issue as well: Microsoft Graph API throwing exception


回答1:


Following this recommendation :

***Hi @Rolson, **Remove the Group.Selected permission for the time being and try again**. – Hari Krishna-- MSFT Identity 1 hour ago***

also solved my issue.Microsoft Graph API throwing exception

@ Hari Krishna- - What is the background of your proposal ?



来源:https://stackoverflow.com/questions/61479622/ms-graph-request-insufficient-privileges

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!