简体   繁体   中英

MS-Graph request: insufficient privileges

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

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM