预先同意的多租户应用程序无法调用图形 API

Multi-tenant application with pre-consent cannot call graph API

我想让我们的合作伙伴帐户中的所有租户自动使用不需要任何用户凭据的应用程序。

为此,我在 azure 中创建了一个多租户网络应用程序,并且可以访问 "Microsoft graph" 应用程序的应用程序权限。

我按照Microsoft's guide启用了预先同意,很顺利。

然后我尝试与我的租户一起测试对图 API 的调用:

POST https://login.microsoftonline.com/<my-tenant-id>/oauth2/token
=> got the token
GET https://graph.microsoft.com/v1.0/users
=> Got the users of my-tenant

然后我尝试了一个客户的租户:

POST https://login.microsoftonline.com/<customer-tenant-id>/oauth2/token
=> got the token
GET https://graph.microsoft.com/v1.0/users
=> 
{
  "error": {
    "code": "Service_InternalServerError",
    "message": "Encountered an internal server error.",
    "innerError": {
      "request-id": "270ef482-e7ca-4184-bb9e-0567b123b7ab",
      "date": "2016-09-15T10:00:14"
    }
  }
}

为什么我会得到这个 500,这个调用在我得到客户租户的 oauth 令牌时不应该起作用吗?

此外,还有一些小问题:预先同意是否适用于之前存在的租户?如果更改权限,是否会影响所有租户而无需执行任何操作?


更新:在尝试了很多东西之后,它开始使用相同的命令。但是,我尝试了另一个随机租户,它给了我 500... 将继续尝试并更新

好像是同意的问题。无论我是否使用新租户,我都必须转到 https://login.windows.net/common/oauth2/authorize?response_type=code&client_id={0}&prompt=admin_consent{0} 是应用程序的 cliendId),然后才能正常工作

因此,自动同意可能有问题,但这需要