How to authenticate in an ASP.NET MVC application from a console application
问题 I have a console application that sends a XML to a MVC application and receive another XML as a response. It works perfectly, but I want to add authorization (for obvious reasons). Here is the code from the console application: using (var wc = new WebClient()) { return GetXmlFromBytes( wc.UploadData("URL", GetBytesFromXml(xmlToSend)) ); } And here is the code from the MVC application: public ActionResult DoSomething() { XElement xml = XElement.Load(new System.IO.StreamReader(Request