Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question

closed as too broad by JeffO, MichaelT, jwenting, mattnz, Thomas Owens Jun 13 at 19:21

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

    
This question seems rather broad, and in some ways, off-topic. If you have a design question (and it seems like you may), we'll need to know more about your requirements. Note, though, that requesting libraries is off-topic for us, and some questions may also be answered on the Information Security Stack Exchange. –  Thomas Owens Jun 13 at 19:23