Securing an Azure .asmx web service for Android and iOS apps - android

I'm developing a standard Azure .NET cloud service with a sql backend. The sql db holds various bits of information including username and password details. I've a .NET app that communicates with Azure using message encryption over WCF using a custom username/password validator. Also I've got two mobile apps written for Android and iOS which currently use some web services I've defined in an small .asmx file (legacy code to enable the mobile apps to easily call the API). I was wanting to add authentication into the mobile apps, but am slowly sinking under the weight of information :)
I had thought Azure mobile services were the way to go (meaning I would have to rewrite the .asmx file using custom API presumably) but this only seems to offer authentication against identity providers like Google, Facebook etc. Ideally I'd want to use our sql backend as an identity provider, but have read various articles saying this is very tricky to do. In fact one article suggested using a commercial solution called Auth0.
I'm not averse to commercial solutions, but really just wondered what the simplest approach to this should be. Azure mobile services or something else?
Any help steering me in the right direction would be great.

You can do "custom" authentication using your own database as the identity provider if you want to but as noted it does require a bit of work (at least more than just turning on Facebook / Twitter / etc). I have two articles that explain how to set up custom auth using Mobile Services here:
http://chrisrisner.com/Authentication-with-Windows-Azure-Mobile-Services
http://chrisrisner.com/Custom-Authentication-with-Azure-Mobile-Services-and-PikShare
The second link provides information on simplifying the scripts involved as well as using the custom API functionality of Mobile Services to handle registration / logging in. For the most part these scripts can be dropped into your mobile service. However, since you have an existing database you'll want to connect your Mobile Service to, you may run into issues making sure the table structures match up with what Mobile Services expect. You may need to massage your schema / create a table specifically for your Mobile Service with the necessary user information if adding the existing table doesn't work right away.

Related

Django restframework API as a backend for offline first mobile app

I've just finished django app for multiple choice questions. However, I wanted to develop Ionic android app version of the web app. It's my first app and I am still learning web development. I'm not sure if Django RestFramework or firebase backend is more suitable for offline first app, particularly with respect to mostly text-based questions.
I suggest that you need to research the both options as there is a use case for each, but Django is not traditionally used for a mobile backend.
You need to weigh up the positive and negative of each and determine what suits your use case, at present you have not provided adequate information in order to make a determination either way.
Using Django as a backend is like saying you want to use WordPress as a backend, that is they are both content management systems that were not designed to serve as mobile backend Api's.
Additionally you need to consider the likelihood of your apps success, and what that means as a user count. If you feel that your app will be a success then don't waste your time with Django as you will very quickly have to spend money to scale the system.
The best option in general terms would be to use Firebase, a system specifically designed as mobile backend Api's.
However, to make an app like Uber, you’re going to require some custom server-side code. For example you’ll want real time updates of vehicle locations, availability, etc. This data can only be generated on the server since you’ll want multiple clients to access it at any given time. Firebase is probably too lightweight for this task, so making your own backend API would be a better option.

Why or when does an app need a server?

I have been searching for a proper answer to this question, have a bit of background in front end development, but with new concepts like SaaS, PaaS, etc. want to get information from experts out there, that could help any newbie to understand what it's all about.
Say I am trying to develop eBay like an app that takes a product from a user and sells it back to the other user who needs it.
Will my app need a backend server? If so why? I am already uploading my app to Google Play Store or Apple Store.
How will the backend server like HEROKU or FIREBASE or AWS help my app?
Can I implement two different services in single app, say for eg., firebase for backend database and HEROKU for payment processing?
Thanks again for your time and information.
SaaS
Answer: SaaS stands for "Software as a Service". In layman's terms, someone developed some software and hosted it somewhere. You can use that hosted software in your software project/product as a third party service (like public API); or directly use that as individual software under some license like Firebase as mentioned.
PaaS
Answer PaaS stands for "Platform as a Service". In layman's terms, someone configured some hardware and exposed the hardware controls via some web based application or REST APIs. You can use that hardware to deploy/run/manage your application without having the actual hardware on premises.
Backend Server
Answer First of all, let me explain the server. The server is a middle-man who serves whatever is requested of it, and all browsers/mobile apps act as client. So for example, the web is all about client-server communication.
So taking the example you mentioned, an eBay-like app takes a product from a user (client action) and puts it on the server (client requests in background for server to put product on server). Then another user opens the app (client action) and searches for the product (mobile client requests server to return that product, if valid and matching search criteria), and then he can buy it (mobile client will request server to complete the purchase).
You have to understand that for any communication between web application, mobile application or desktop application, there will always be a server. Even in file sharing applications like shareit, one mobile app works as server and same mobile app elsewhere works as client.
Yes, backend servers like Heroku or Firebase or AWS will help your app to complete your application business flow.
Yes, you can implement two different services in single app, say for example, Firebase for backend database and Heroku for payment processing or hosting your application/APIs.
Unless you are experienced with building distributed applications that can persist data across multiple nodes in a consistent manner, and ensure data available, I'd say you most definitely need some kind of backend. Unless of course you only plan to have user-to-user transactions, that can rely on direct messaging between client applications - which seems pretty pointless and quite far from the requirements of an EBAY-like product.
In terms of the architecture, you can follow many different approaches, but in most of them you will require some sort of data access layer. I'd recommend looking into the three-tier software design pattern (https://en.wikipedia.org/wiki/Multitier_architecture) to better understand the way this type of software product is typically designed.
After sorting out which type of data persistence you prefer, you'll need to setup the backend where your mobile app will connect to retrieve the data from (things like products being sold, user profiles and ratings, your own history). Of course you could also connect directly to the database from the app, but that would be a big mistake - it would meaning making the DB access publicly available, and thus exposed to attack, not to mention that you would be hard-pressed to find a solution for user registration and authentication, which would have to be provided by other means anyway. Typically your backend will also manage user registration and authorisation.
Heroku, Firebase and AWS are all very different, each with their strengths and weaknesses, but there's nothing like trying them out to see what fits best. What you refer to as "Google Server" and "Apple Server" sounds like a misconception, and you probably mean the Google Play Store and the Apple Store. These are not applicational servers that you can use as a backend, and serve only as a repository for your mobile app from where users can download it, and nothing else.
Without some sort of backend mechanism, the challenge of making data available for the consumption of multiple users would be overwhelming.
I know this isn't a very specific answer, but your question is quite broad-reaching, and it seems you need to look into some basic fundaments of software engineering before going into more detail.

How to set up a server for android app?

I am trying to create an android application in which an user will pretty save some data in database-like user data, photos and also be able to retrieve.
But I am clueless how to set up a server, connect to some database etc.
Can somebody help me point to right resources for end-to-end installation of server, database, and its interaction with the android application
Just set up a basic server that works over HTTP, and use HTTP libraries for android to make requests and handle results in the device. There are plenty of technologies with which you could make the server, just google building REST API with PHP/.net/java (whichever language you are comfortable with).
If you are mobile app developer and want to create server-client app then better use any back-end service rather than implementing new by own. Some most advanced and simple to use services are Parse and Firebase , BaasBox also there are many more.
And the plus point is this services free of cost until you have very large users.

Can I create an Android app similar to a dynamic client server web application?

I am new to Android and taking the risk of doing a final year project of building an Android app. I would like to know whether I can create Client-server architecture application in Android. I'd like the front end to be the mobile app. Also, where do you store data (I don't know where to store data exactly) at back end.
Use Restful web Services with json(Ex: WCF in the backend with Sql Server)
For Mobile App, These are useful tutorials http://developer.android.com/training/index.html,
http://www.vogella.com/tutorials/android.html.
Very many, if not most, existing Android apps retrieve data over the Internet and display it (e.g. the StackExchange, Yelp, or Facebook apps). They are clients requesting data from servers and therefore fit into the definition of being “client/server”. I'm hard-pressed to think of an app on my phone that isn't a client to some kind of web service.
If, as your question suggests, you are using HTTP for client/server communication, there is no reason why the client platform (Android) should have any impact whatsoever on the server-side implementation. In the wild, Android clients are served by servers implemented with every conceivable combination of OS, language, and database. Therefore “where do you store data?” is an unanswerable question, as the answer depends entirely on implementation choices that you make on the server side.

Which MBaaS platform to use for a specific project: Parse or Google Cloud

My Android project currently requires an authentication of some sort (mobile phone number / facebook / gmail... I haven't decided yet), frequent read/write operations from the server's db (not a big amount of data, and no images/videos), push notifications and in the future, possibly complex queries on the data stored.
I started reading about Parse and Google cloud (in google, specifically about mobile backend starter).
I can't seem to find a comparison between the two. I've read that both have relatively easy implementations, but except for the platforms (I'm using Android, so both work for me), I can't find a place that says "Parse is better at ... and Google cloud is better at ...".
So my questions are:
Can anyone please give a recommendation / reference?
Does one of the above platforms at all fit my project? (I am familiar with AWS, and would like to avoid it so I will not need to worry about stability and scalability)
Shameless plug: I'm a developer at kii.com
You can also take a look at Kii Cloud MbaaS
Among its features:
User management, including authentication using Facebook credentials.
Data management that never locks you into any schemas.
File storage and cloud backup for your app.
Push notifications so you can push messages to your users or to your
app itself with updated instructions for functionality.
Geolocation so you can offer location-based services.
Server extension to define your own business logic without managing
servers.
Android, iOS, html5 and unity support

Categories

Resources