ASP.NET MVC WebService - Security for Industrial Android Clients
- by Chris Nevill
I'm trying to design a system that will allow a bunch of Android devices to securely log into an ASP.NET MVC REST Web service.
At present neither side are implemented. However there is an ASP.NET MVC website which the web service will site along side. This is currently using forms authentication.
The idea will be that the Android devices will download data from the web service and then be able to work offline storing data in their own local databases, where users will be able to make updates to that data, and then syncing updates back to the main server where possible.
The web service will be using HTTPS to prevent calls being intercepted and reduce the risk of calls being intercepted.
The system is an industrial system and will not be in used by the general Android population. Instead only authorized Android devices will be authorized by the Web Service to make calls.
As such I was thinking of using the Android devices serial number as a username and then a generated long password which the device will be able to pick up - once the device has been authorized server side.
The device will also have user logins - but these will not be to log into the web service - just the device itself - since the device and user must be able to work offline.
So usernames and passwords will be downloaded and stored on the devices themselves.
My question is... what form of security is best setup on the web service?
Should it use forms Authentication? Should the username and password just be passed in with each GET/POST call or should it start a session as I have with the website?
The Android side causes more confusion. There seems to be a number of options here
Spring-Android, Volley, Retrofit, LoopJ, Robo Spice which seems to use the aforementioned Spring, Retrofit or Google HttpClient. I'm struggling to find a simple example which authenticates with a forms based authentication system. Is this because I'm going about this wrong? Is there another option that would better suite this?