问题
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