API returns 创建在线会议端点时被禁止

API returns Forbidden when creating an online meeting endpoint

我正在尝试 create an online meeting endpoint

令牌具有正确的范围 ("scp": "OnlineMeetings.ReadWrite openid TeamsApp.ReadWrite profile email") 但是当我使用以下正文调用 POST /v1.0/me/onlineMeetings

{
  "startDateTime":"2019-07-12T14:30:34.2444915-07:00",
  "endDateTime":"2019-07-12T15:00:34.2464912-07:00",
  "subject":"User Token Meeting"
}

我得到:

{
    "error": {
        "code": "Forbidden",
        "message": "Forbidden",
        "innerError": {
            "date": "2021-01-06T13:35:38",
            "request-id": "cc25adbc-2e37-4626-8c14-4f90038056cd",
            "client-request-id": "cc25adbc-2e37-4626-8c14-4f90038056cd"
        }
    }
}

我在使用 Graph Explorer 时也收到禁止响应。

api调用仅支持工作或学校账户登录,不支持微软个人账户,也不支持来宾账户。检查!


更新:

  1. 确保您登录的是工作帐户(这是一个 AAD 帐户,而不是 B2C 帐户)。如果你调用https://graph.microsoft.com/v1.0/me,你会发现你的工作账号的ID是这样的,"id": "987932c9-f062-48e2-8ced-22cb6896dfce"和Microsoft 帐户的 ID 是这样的 "id": "5d9ee9b4b2ad3bfe".

  2. 解析您的访问令牌并确保 acct 声明是 0

  3. 尝试在请求正文中添加组织者:

{
      "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"
            }
          }
        }
      }
    }

问题是我针对特定租户授权了用户:

https://login.microsoftonline.com/550fae72-d251-43ec-868c-373732c2704f/oauth2/v2.0/authorize

而不是:

https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize