Ensure that my C# desktop application is making requests to my ASP .NET MVC action?

Posted by Mathias Lykkegaard Lorenzen on Stack Overflow See other posts from Stack Overflow or by Mathias Lykkegaard Lorenzen
Published on 2012-09-03T15:23:03Z Indexed on 2012/09/07 9:38 UTC
Read the original article Hit count: 184

Filed under:
|
|
|
|

I've seen questions that are almost identical to this one, except minor but important differences that I would like to get detailed.

Let's say that I have a controller and an action method in MVC which therefore accepts requests on the following URL: http://example.com/api/myapimethod?data=some-data-here.

This URL is then being called regularly by 1000 clients or more spread out in the public. The reason for this is crowdsourcing. The clients around the globe help feed a global cache on my server, which makes it faster for the rest of the clients to fetch the data.

Now, if I'm sneaky (and I am), I can go into Fiddler, Ethereal, Wireshark or any other packet sniffing tool and figure out which requests the program is making.

By figuring that out, I can also replicate them, and fill the service with false corrupted data.

What is the best approach to ensuring that the data received in my ASP .NET MVC action method is actually from the desktop client application, and not some falsely generated data that the user invented?

Since it is all based on crowdsourcing, would it be a good idea for my users to be able to "vote" if some data is falsified, and then let an automatic cleanup commence if there are enough votes?

I do not have access to a tool like SmartAssembly, so unfortunately my .NET program is fully decompilable. I realize this might be impossible to accomplish in an error-proof manner, but I would like to know where my best chances are.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET