代码之家  ›  专栏  ›  技术社区  ›  Evan Gertis

通过graph api将用户添加到Azure广告组

  •  0
  • Evan Gertis  · 技术社区  · 6 年前

    我正在关注微软的文档 https://docs.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0 .我的目标是使用graph api将用户添加到特定组。当我提出请求时

    POST https://graph.microsoft.com/v1.0/groups/{group-id}/members/$ref
    

    一身

    {"@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{user-id}"}
    

    我得到以下错误

    {
      "error": {
        "code": "Authorization_RequestDenied",
        "message": "Insufficient privileges to complete the operation.",
        "innerError": {
          "date": "2020-09-08T00:14:25",
          "request-id": "bcc05c0f-8195-4744-8736-bd30586a7663"
        }
      }
    }
    

    有人能帮助理解需要添加哪些内容才能使其生效吗?

    谢谢 埃文

    0 回复  |  直到 6 年前
        1
  •  3
  •   unknown    6 年前

    根据 Add member ,我们在中需要以下权限之一: scope :

    enter image description here

    请导航到您的应用程序->门户中的API权限。添加Microsoft Graph的一个权限,并授予租户管理员许可。

    如果你使用 client credentials flow ,您需要添加应用程序权限。委托权限适用于其他流。

    推荐文章