Asp.net MVC Web App and iOS Mobile App

I am currently writing a web application in ASP.NET MVC while it is basically a simple CRUD web application. The database is hosted in the cloud and I am using Entity Framework to interact with it.

I know that further in the development cycle, we will need to make a mobile app (iOS with swift) that will interact with the same database, so I want to have a nice framework that can handle both without much code duplication or DAL while keeping while being safe.

These are the options I have so far:

  • Write my MVC web application and further down the line, make http requests to my controller from my application. Possible issues: security and authentication of these calls?
  • Write my MVC Web Application and MVC Web API. Both my controllers of my web app and iOS app will interact with this API. Possible issues: Will this setup work with an asp.net MVC web application?
  • Write additional web methods in my MVC controllers specifically for the Rite api call to my iOS app. Possible problems: is it possible at all?
+3


source to share


1 answer


I highly recommend that you go for an API that both your web app ASP.NET MVC

and mobile app talk to . The use ASP.NET Web API

for this purpose - a good choice, as it works well with the current, and with consumers ( MVC

and iOS

) that you have. REST

is a very open standard and thus allows a wide range of devices to be connected to it; ASP.NET Web API

was built with REST

.



A JSON web token

(JWT) approach to security will also be smart as it will allow you to support a wide range of devices (cookies are limited in this regard). You might want to consider using OAuth

on ASP.NET Web API

to leverage open standards protection and use authentication through a third party (Google, Microsoft, etc.) if desired or feasible for your project.

+3


source







All Articles