简体   繁体   English

MS-Graph 请求:权限不足

[英]MS-Graph request: insufficient privileges

I'm having an issue with my .net core daemon-application recently.我最近遇到了我的 .net 核心守护程序应用程序的问题。 This worked fine at least a couple of days ago.这至少在几天前工作得很好。

My request goes to https://graph.microsoft.com/v1.0/users :我的请求转到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.我尝试在 Azure 中重置 API 权限,确保 User.Read.All 权限,撤销/删除/授予管理员同意并重置令牌密码,一切都无济于事。 When using Graph Explorer with my personal account (and thus using delegated permissions instead of application permissions), everything works fine.将 Graph Explorer 与我的个人帐户一起使用时(因此使用委派权限而不是应用程序权限),一切正常。

Is this a Graph-Api-Problem?这是一个 Graph-Api-Problem 吗? Am I doing something wrong?难道我做错了什么? It seems others are having this issue as well: Microsoft Graph API throwing exception似乎其他人也有这个问题: 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 Microsoft Graph API 抛出异常

@ Hari Krishna- - What is the background of your proposal? @ Hari Krishna- - 你求婚的背景是什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ms-graph API 与 C#; 如何修复此驱动项错误 - ms-graph API with C#; how to fix this driveitem error 使用EWS创建的MS-Graph API检索SingleValueExtendedProperties - Retrieve SingleValueExtendedProperties with MS-Graph API created with EWS 如果存在,如何更改ms-graph替换文件的默认行为? - How to change the default behavior of ms-graph of replacing file if it exist? 使用 MS-Graph API 搜索特定邮件时出现问题 - Problem searching for specific Mails using MS-Graph API Microsoft Graph API - 权限不足,Request_ResourceNotFound - Azure 权限问题 - Microsoft Graph API -Insufficient privileges, Request_ResourceNotFound - Azure Permissions Issues 图 API - 权限不足,无法完成操作 - Graph API - Insufficient privileges to complete the operation Graph API-在Microsoft图形控制台应用程序中获取权限不足 - Graph API - Getting Insufficient privileges in microsoft graph console application Microsoft graph - 尝试获取用户信息时权限不足 - Microsoft graph - Insufficient privileges when trying to get user info 尝试访问Azure Graph API时,权限不足错误 - Insufficient privileges error when trying to access Azure Graph APIs 具有UnauthorizedAccessException的StreamWriter特权不足 - StreamWriter Insufficient Privileges With UnauthorizedAccessException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM