MS-Graph请求:权限不足 [英] MS-Graph request: insufficient privileges

查看:127
本文介绍了MS-Graph请求:权限不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在.net核心守护程序中遇到了问题.至少在几天前,效果很好.

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

我的请求转到 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();

并返回以下错误:

{
  "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"
    }
  }
}

我尝试重置Azure中的API权限,确保获得User.Read.All权限,撤消/删除/授予管理员同意并重置令牌密钥,但都无济于事.当通过我的个人帐户使用Graph Explorer(从而使用委托权限而不是应用程序权限)时,一切正常.

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.

这是Graph-Api问题吗?难道我做错了什么? 似乎其他人也有这个问题: Microsoft Graph API抛出异常

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

推荐答案

遵循此建议:

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

也解决了我的问题. Microsoft Graph API抛出异常

@ Hari Krishna--您的提案的背景是什么?

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

这篇关于MS-Graph请求:权限不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆