azure - 将成员添加到 Microsoft Graph API 中的目录角色 - 权限不足

标签 azure office365 azure-active-directory microsoft-graph-api

docs state :

One of the following scopes is required to execute this API: Directory.ReadWrite.All OR Directory.AccessAsUser.All

http://jwt.calebb.net/确认 Directory.ReadWrite.All 是我的 token 的角色之一,但是以下请求:

POST https://graph.microsoft.com/v1.0/directoryRoles/{directoryRoleObjectId}/members/$ref
{
  "@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{userObjectId}"
}

返回:

{
  "error": {
    "code": "Authorization_RequestDenied",
    "message": "Insufficient privileges to complete the operation.",
    "innerError": {
      "request-id": "{id}",
      "date": "2016-11-25T15:18:07"
    }
  }
}

对 DirectoryRole 运行 GET 会返回数据,因此读取权限似乎有效。我错过了什么?

最佳答案

Directory.AccessAsUser.All(使用管理员帐户)允许您在目录角色中添加/删除用户。注意:这是委托(delegate)权限。据我所知,没有其他权限允许此操作,我们需要修复我们的文档。我需要与我们的一些开发团队核实此事。
问您的问题:您需要使用应用程序权限而不能使用委派权限是否有原因?

希望这有帮助,

关于azure - 将成员添加到 Microsoft Graph API 中的目录角色 - 权限不足,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40808329/

相关文章:

azure - 将 Web API 上传到 Azure 导致 Blazor Web App 无法访问

azure - API 请求的正确范围是什么

spring-boot - Azure Spring Boot : PKIX path building failed: sun. security.provider.certpath.SunCertPathBuilderException:

azure - 如何在Azure蓝图中正确使用 `outputs`?

.net - WindowsAzure.Storage v2 StorageException

email - 用于 Exchange/O365 POP3 和 SMTP 的双足客户端凭据 OAuth 流程

outlook - 通过 Office365 API 获取按 conversationId 过滤的消息

azure - 是否可以通过单用户登录提示使用 MFA 对 Connect-AzAccount 和 Connect-AzureAD 进行身份验证?

azure - Ms Azure 与 Google Colab BERT 训练性能的令人惊讶的结果,不知道如何解释

.net - 作为服务运行时找不到 PowerShell 模块