为什么切换到Azure Web应用程序/API到多租户不起作用?

为什么切换到Azure Web应用程序/API到多租户不起作用?

问题描述:

我在Microsoft Azure上部署了Web app / API,以单租户模式工作.我需要使其他租户的用户能够使用我的API.

I have a Web app / API deployed on Microsoft Azure working in single tenant mode. I need to enable users from other tenants to be able to use my API.

我发现此信息包含逐步指南,以启用多租户身份验证, https://blog.mastykarz.nl /configuring-multi-tenant-authentication-azure-app-service-authentication-options/

I found this post with step-by-step guide to enable multi-tenant authentication, https://blog.mastykarz.nl/configuring-multi-tenant-authentication-azure-app-service-authentication-options/

但是当我尝试将Web API的Multitenanted属性更改为是时,它显示无法更新App ID URI应用程序属性",并显示以下错误详细信息:

but when I try to change Web API's Multitenanted property to Yes, it says "failed to update App ID URI application property" with following error detail:

{"errorCode":"HostNameNotOnVerifiedDomain","localizedErrorDetails":
{"errorDetail":"Host name in property identifierUris is not on any verified
 domain of the company or its subdomain."},
"operationResults":null,"timeStampUtc":"2017-01-11T00:14:37.3270764Z",
"clientRequestId":"...","internalTransactionId":"...",
"upn":"...@gmail.com","tenantId":"...","userObjectId":"..."}

当前,应用程序ID URI拥有我的Web API的地址(并且按预期在单租户模式下工作)https://(..).azurewebsites.net对于多租户模式,这不正确吗?

Currently App ID URI holds address of my Web API (and it is working in single tenant mode as expected) https://(..).azurewebsites.net is this not correct for multi tenanted mode?

否.对于多租户应用程序,应用程序ID URI必须位于您的AAD中的域中.因此,如果我的AAD包含test.onmicrosoft.com和company.com之类的域,则允许的URI为:

No. With multi-tenant apps the App ID URI has to be in a domain in your AAD. So if my AAD contains domains like test.onmicrosoft.com and company.com, then allowed URIs would be:

  • https://test.onmicrosodt.com/MyApi
  • https://company.com/MyApi

您不拥有azurewebsites.net域,因此无法使用它.

You don't own the azurewebsites.net domain and thus can't use it.