【发布时间】:2016-08-04 03:55:35
【问题描述】:
为使用 ADAL.js 提供的示例代码如下所示:
window.config = {
instance: 'https://login.microsoftonline.com/',
tenant: '[Enter your tenant here, e.g. contoso.onmicrosoft.com]',
clientId: '[Enter your client_id here, e.g. g075edef-0efa-453b-997b-de1337c29185]',
postLogoutRedirectUri: window.location.origin,
cacheLocation: 'localStorage', localhost.
};
var authContext = new AuthenticationContext(config);
这工作正常,但我正在尝试允许访问多租户应用程序 - 来自组织的用户只有在其帐户管理员授予应用程序访问权限的情况下才能登录。
我已经实现了第一部分 - 允许管理员用户启用 - as per this example。
所以此时我的应用程序已列在第三方的 Active Directory 中。
我不确定租户的正确设置应该是什么。我尝试使用“common”,但随后会显示一个对话框,询问个人用户是否愿意授予对应用程序的访问权限,这不是我想要的。
如果我正在制作一个直接的 MVC 应用程序,我将继续上面的示例,在服务器上使用 app.UseOpenIdConnectAuthentication。但我的应用是一个 SPA,带有 Web Api 后端,我一直无法找到适用于这种场景的多租户示例。
【问题讨论】:
标签: active-directory azure-active-directory adal adal.js