简体   繁体   中英

MVC/SPA Authentication Scenarios for Azure AD

These are Application Types and Scenarios that Azure AD supports:
Web Browser to Web Application
Native Application to Web API
Web Application to Web API
Daemon or Server Application to Web API

I have two questions:

  1. I would like to understand where my scenario below fits.
    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)

  2. Which Azure Active Directory Code Samples are the closest to my scenario below:

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.

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.

Thanks, Rad

I am also facing the same 'i dont know' issue :) But far as i have researched the authorization flow from SPA aplication to the web api. You still need webserver(mvc) project that will privide redirecting to the Identity provider (azure AD) login page and on the IP callback you will need to inject baerer token to Angular auth service that will send token to the api or deal with the refresh token.

So for me I think that, Web Application to Web API, is the right direction programming.

pls comment if i'm wrong

Currently i'm investigating link http://code.msdn.microsoft.com/windowsazure/MyCompany-demo-applications-eedab900

update 2: http://www.cloudidentity.com/blog/2014/04/22/AUTHENTICATION-PROTOCOLS-WEB-UX-AND-WEB-API/

Maybe it will be helpful to us.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM