【发布时间】:2014-06-09 00:37:06
【问题描述】:
这些是 Azure AD 支持的应用程序类型和方案:
Web Browser to Web Application
Native Application to Web API
Web Application to Web API
Daemon or Server Application to Web API
我有两个问题:
我想了解我的以下场景适合的位置。
我想我需要使用 JWT 令牌,似乎 Native Application to Web API 是最接近的, 但我仍然需要 Asp.Net MVC 应用程序来提供客户端 Angular MVC 资源(html 模板、控制器和 Rest 服务)下面哪个Azure Active Directory Code Samples最接近我的场景:
我想创建一个多租户 Angularjs(使用 Asp.Net MVC 5 交付)和使用 Azure AD 保护的 Rest Web API 2。我想让租户选择他们的域名,比如 firstTenant.com, smt.firstTenant.com 或拥有像 firstTenant.MySaaS.com、secondTenant.MySaaS.com 这样的子域 或 MySaaS.com/firstTenant、MySaaS.com/secondTenant 或类似的域命名方案。
我会使用某种 IoC 容器来为我的 SaaS 应用程序添加自定义或类似的容器,以便为每个租户提供特定的功能(GUI 和业务逻辑和数据库)。 我会使用 Asp.Net MVC 应用程序,它将为每个租户定制 SPA 资源(html 模板、.js 控制器、.js 服务、.css、图像等),并使用一些分区技术从数据库中检索租户和用户特定的内容从 Rest API 控制器调用。
谢谢, 辐射
【问题讨论】:
-
恕我直言,JWT 代币将是正确的选择。希望您对 WebAPI 进行 AJAX 调用,这也需要根据您从 AD 获得的 JWT 令牌进行授权。
标签: asp.net-mvc angularjs multi-tenant asp.net-web-api2 azure-active-directory