title: MVC/SPA Authentication Scenarios for Azure AD
body: <p>These are Application Types and Scenarios that Azure AD supports:<br>
  <a href="http://msdn.microsoft.com/en-us/library/azure/dn499820.aspx#BKMK_Browser" rel="nofollow">Web Browser to Web Application</a><br>
  <a href="http://msdn.microsoft.com/en-us/library/azure/dn499820.aspx#BKMK_Native" rel="nofollow">Native Application to Web API</a><br>
  <a href="http://msdn.microsoft.com/en-us/library/azure/dn499820.aspx#BKMK_Web" rel="nofollow">Web Application to Web API </a><br>
  <a href="http://msdn.microsoft.com/en-us/library/azure/dn499820.aspx#BKMK_Server" rel="nofollow">Daemon or Server Application to Web API</a>  </p>
  
  <p>I have two questions:  </p>
  
  <ol>
  <li><p>I would like to understand where my scenario below fits.<br>
  I think I need to use JWT tokens and it seems that Native Application to Web API is the closest,
  but I still need Asp.Net MVC application to deliver Client side Angular MVC resources (html templates, controllers and Rest services)</p></li>
  <li><p>Which <a href="http://msdn.microsoft.com/en-us/library/azure/dn646737.aspx" rel="nofollow">Azure Active Directory Code Samples</a> are the closest to my scenario below:  </p></li>
  </ol>
  
  <p>I would like to create a multi-tenant Angularjs (delivered using Asp.Net MVC 5) and Rest Web API 2 secured with Azure AD. I would like to have tenants choose their domain names like firstTenant.com,
  smt.firstTenant.com or to have subdomains like firstTenant.MySaaS.com, secondTenant.MySaaS.com
  or MySaaS.com/firstTenant, MySaaS.com/secondTenant or similar domain naming scheme.</p>
  
  <p>I would use some kind of IoC container to add customization to my SaaS application or similar to deliver specific functionality to each tenant (GUI and business logic and DB).
  I would use and Asp.Net MVC application that will custom tailor SPA resources (html templates, .js controllers, .js services, .css, images etc) to each tenant and use some partitioning techniquest to retrieve tenant and user specific content from DB called from Rest API controllers.</p>
  
  <p>Thanks,
  Rad</p>