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

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

问题描述

登录Azure网站后出现此错误:

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

AADSTS50194:应用程序"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx"未配置为多租户应用程序.在'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管理员,则可能是错误消息中列出的确切原因-您不能使用通过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"

需要更改为:

let 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天全站免登陆