Last Updated: 2017-01-16
I am thinking about choosing between NancyFx and ASP.NET Core for backend for hybrid Mobile app like Ionic+Angular or OnsenUI+Angular.
- I want the backend to run on Windows and the language to be C#, so my colleagues will be happy.
- The backend should be a REST server, since it works great with Angular.
- I am already happy about AngularJS, so there I don’t want to make choices.
A little pros and cons test would be good to start with
- Nancy REST
- The ASP.NET Core version is beta (not relevant since host is not Core)
- Colleagues might prefer Core
- ASP.NET Web API Core
- ASP:NET Web API 4.x
- In common:
- Our host will be ASP.NET (not Core)
- Common project for both MVC Views and REST API
- Both support Async
I think my colleagues will prefer ASP.NET Core, so were it not for them I would have chosen Nancy.
Hybrid Mobile Frontend
F7 and Famo.us could have been evaluated, but I got a quick impression that they don’t have to be evaluated.
- It seems to the most mature.
- Ionic 2 uses TypeScript
- VS2015 Update 3
- Includes ASP.NET and Web Tools 2015.1
- Includes Visual Studio Tools for Apache Cordova Update 10
- NPM Task Runner
- VS2015 Update 3
Well I haven only skimmed Onsen a little and so far it does not look superior to Ionic, so I’ll stick with Ionic as I know a little.
IWA samples can be taken from WinJS.
MVC serverside Frontend
The Hybrid Mobile frontend takes initially too much time to learn. So instead I’ll start out with an MVC serverside frontend having AngularJS as clientside MVC.
As with the REST server I’ll choose between Nancy, ASP.NET Core or ASP.NET 4.x.
Since I chose ASP.NET 4.x as REST server I’ll also choose ASP.NET 4.x as MVC server. It is also included in the Web API template, so it is ready for use (e.g. in the Home controller).
So the challenge is to add Angular to ASP.NET 4.x MVC.
HowTo add AngularJS to:
- Nancy MVC – Links
- ASP.NET MVC Core – Links
- ASP.NET MVC 4.x – Links
- Hands On Lab: Build a Single Page Application (SPA) with ASP.NET Web API and Angular.js
- Using Angular for Single Page Applications (SPAs)
- PhoneCat Tutorial App
- Angular ref: What is a Module?
- Angular 1 Style Guide
- Angular 2 Style Guide
I need some access control. Who should be Identity provider?
This section is quite a mess, but after circling around a bit It seems like we should use an internal ADFS indentity provider, that supplies JWT tokens. Link futher down.
- ASP:NET 4.X authentication
- Secure a Web API with Individual Accounts and Local Login in ASP.NET Web API 2.2
- Authentication and Identity
- Postman Authentication helpers
Integrated Windows Authentication (IWA) will only be possible on devises having logged onto the internal network via WiFi. Our company phones are such devices, so if I can find client IWA samples, then that can be an option.
- WinJS.xhr calls (Win 8.1)
- WinJS XMLHttpRequest (UWP)
- $http (Angular)
- IWA in ASP.NET
- IWA in IIS
- WinAuth in Web.API
- How to pass Windows Authentication credential from client to Web API service
We also have a company CBA provider, but then it is more trouble to code the REST service, since there has to be registered some trust between the two.
Perhaps instead the service should provide its own userbase, logon and authentication instead.
- Passport and Win Hello
- JSON Web tokens (JWT)
Other External providers
- Cordova using providers
- Using web authentication broker towards online Id Providers
- Web authentication samples
- Web authentication broker