【问题标题】:Getting Forbidden 403 error while creating OnlineMeeting using Microsoft Graph api使用 Microsoft Graph api 创建 OnlineMeeting 时出现 Forbidden 403 错误
【发布时间】:2020-07-31 18:58:57
【问题描述】:

我正在尝试通过 https://graph.microsoft.com/beta/communications/onlineMeetings 创建在线会议。 最初我收到 403 Forbidden 错误。然后我在 azure 上的注册应用程序上授予委托和应用程序权限(OnlineMeetings.ReadWrite,OnlineMeetings.ReadWrite.All)。然后 403 错误消失了,我收到了新的错误 400 错误请求(Organizer.Identity.User.Id 丢失)。 然后我提供在线会议帖子请求如下-:

{
  "startDateTime":"2020-04-20T14:33:30.8546353-07:00",
  "endDateTime":"2020-04-20T15:03:30.8566356-07:00",
  "subject":"Application Token Meeting",
  "participants": {
    "organizer": {
      "identity": {
        "user": {
          "id": "cb6d6636-1c9e-457c-b904-5da8265a8927"
        }
      }
    }
  }
}

我再次收到 403 Forbidden 错误。 我在https://graph.microsoft.com/v1.0/usershttps://graph.microsoft.com/beta/invitations 的帮助下创建了用户。 用户是在我的应用程序中创建的,我授予权限(User.ReadWrite.All,Directory.ReadWrite.All,Directory.AccessAsUser.All,User.ReadWrite.All,Directory.ReadWrite.All) 但是错误(403)没有改变。

我的问题是如何在 microsoft graph API 中给予用户授权。

【问题讨论】:

  • 如果我的回答对您有帮助,您可以接受它作为答案(单击答案旁边的复选标记,将其从灰色切换为已填充。)。这对其他社区成员可能是有益的。谢谢。

标签: api graph microsoft-teams azure-ad-graph-api


【解决方案1】:

所需的权限是委派权限:OnlineMeetings.ReadWrite。请参阅参考资料here

403 错误意味着您的访问令牌不包含所需的权限。你可以这样添加:

不要忘记点击“为{您的租户}授予管理员许可”。

您应该实现Get access on behalf of a userget an access token 来调用/communications/onlineMeetings 端点。

http 示例供您参考:

POST https://graph.microsoft.com/beta/communications/onlineMeetings
Content-Type: application/json
Authorization: Bearer {access token}

{
  "startDateTime":"2019-09-09T14:33:30.8546353-07:00",
  "endDateTime":"2019-09-09T15:03:30.8566356-07:00",
  "subject":"Application Token Meeting",
  "participants": {
    "organizer": {
      "identity": {
        "user": {
          "id": "550fae72-d251-43ec-868c-373732c2704f"
        }
      }
    }
  }
}

您可以了解有关Use the access token to call Microsoft Graph 的更多详细信息。不要忘记将Authorization: Bearer {access token} 放在请求标头中。

【讨论】:

  • 我有同样的问题......在我的应用程序中......我无法在邮递员中测试这个 API.. 错误 403
  • 我使用用户访问令牌使用在线会议创建了在线会议。如何在不要求用户输入用户名和密码的情况下使用用户访问令牌开始会议。
猜你喜欢
  • 2020-04-28
  • 1970-01-01
  • 2021-04-26
  • 1970-01-01
  • 2019-06-05
  • 1970-01-01
  • 2023-03-14
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多