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

查看:35
本文介绍了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 throwing exception

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天全站免登陆