如何在 angular 2 中实现 Azure 多租户应用程序访问

How to implement Azure multi tenant app access in angular 2

我是 angular 2 的新手。我正在 angular 2 中处理多租户应用程序。 我在 angular2 中的 ASP.netMVC.But 中完成了多租户应用程序,我不知道。

我在 Angular 2 中通过 following this article

完成了单租户身份验证

任何适用的答案。

提前致谢....!

首先,您可以通过在 Azure 门户中的应用程序注册属性页面找到 "Multi-Tenanted" 开关并将其设置为 "Yes".[=14= 来注册多租户]

然后请更新您的代码以将请求发送到 /common 。对于多租户应用程序,应用程序事先不知道用户来自哪个租户,因此您无法将请求发送到租户的端点.相反,请求被发送到一个跨所有 Azure AD 租户多路复用的端点:

https://login.microsoftonline.com/common

在您的代码中,尝试将 tenant 值替换为 common。请单击 here 了解有关如何使用多租户应用程序模式登录任何 Azure Active Directory (AD) 用户的更多详细信息。

我可以在 Angular 2 中访问多租户应用程序。 按租户价值 common

谢谢楠

    public AdalConfig(): any {
    return {
        tenant: 'common',
        clientId: 'xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx',
        redirectUri: window.location.origin + '/',
        postLogoutRediFFFFrectUri: window.location.origin + '/'
    };

}