Accessing an MVC method with a Windows Service

I have a windows service which accesses a function in an MVC application to do some work.

The only way I was able to allow the service to access the function was by granting anonymous access to the function like this:

public JsonResult UploadFile(ImportedFileModel uploadedFile)


I wonder, is there any safer way to do this. I am not convinced that [AllowAnonymous] is a good solution.

Is there anyway I can make the access specific to the Windows Service?

Many thanks.


Expose your function as an web method. If upgrade is an option, you can upgrade your application to ASP.NET MVC 4 and use build in Web API framework.

There are a lot of ways how to manage access to your web methods. Check out for example OAuth.

Good luck!

Need Your Help

In Torch how do I create a 1-hot tensor from a list of integer labels?

indexing torch one-hot

I have a byte tensor of integer class labels, e.g. from the MNIST data set.

Big-O for Eight Year Olds?

algorithm theory big-o metrics

I'm asking more about what this means to my code. I understand the concepts mathematically, I just have a hard time wrapping my head around what they mean conceptually. For example, if one were to

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.