“使用特定于租户的端点或将应用程序配置为多租户"登录我的 Azure 网站时 [英] "Use a tenant-specific endpoint or configure the application to be multi-tenant" when signing into my Azure website

查看:17
本文介绍了“使用特定于租户的端点或将应用程序配置为多租户"登录我的 Azure 网站时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在登录 Azure 网站后收到此错误:

I'm getting this error after I sign into my Azure website:

AADSTS50194:应用程序xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx"未配置为多租户应用程序.'10/15/2018' 之后创建的此类应用程序不支持使用/common 端点.使用特定于租户的端点或将应用程序配置为多租户.

AADSTS50194: Application 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx' is not configured as a multi-tenant application. Usage of the /common endpoint is not supported for such applications created after '10/15/2018'. Use a tenant-specific endpoint or configure the application to be multi-tenant.

推荐答案

如果您是 Azure 管理员,收到此消息,可能是由于错误消息中列出的确切原因 - 您不能使用 common 用于 MSFT 登录到租户特定应用程序的 API 端点.

If you are an Azure administrator getting this message, it may be for the the exact reason that is listed in the error message - you can not use the common API endpoint to MSFT logins to tenant-specific applications.

就我而言,我正在使用示例代码配置应用程序注册 - 示例代码需要使用新端点进行修改.即以下行:

In my case, I was configuring an app registration with sample code - the sample code needed to be modified with a new endpoint. I.e the following line:

let kAuthority = "https://login.microsoftonline.com/common"

需要改为:

让 kAuthority = "https://login.microsoftonline.com/MY_TENANT_NAME"

可以通过在 Azure 搜索栏中键入租户状态"来获取 Azure 组织的租户名称.

The tenant name for your Azure organization can be obtained by typing "Tenant Status" into the Azure search bar.

Xamarin:以上说明适用于 MSAL iOS - 对于 Xamarin MSAL Android/iOS,没有直接的方法在主调用中设置权限.它需要链接到交互式登录调用.

Xamarin: The above note worked for MSAL iOS - for Xamarin MSAL Android/iOS, there was no direct way to set the authority in the main call. It needs to be chained to the interactive login call.

例如,这里的示例代码:

E.g., the sample code here:

authResult = await App.PCA.AcquireTokenInteractive(App.Scopes)
                      .WithParentActivityOrWindow(App.ParentWindow)
                      .ExecuteAsync();

需要改成这样:

authResult = await App.PCA.AcquireTokenInteractive(App.Scopes)
                      .WithAuthority("https://login.microsoftonline.com/YOUR_TENANT_NAME")
                      .WithParentActivityOrWindow(App.ParentWindow)
                      .ExecuteAsync();

这篇关于“使用特定于租户的端点或将应用程序配置为多租户"登录我的 Azure 网站时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆