I have a Windows application which needs to call a Forms Authenticated MVC action. The problem is, I am not sure how to authenticate a call from a Windows application into a Forms Authenticated MVC application.
The following code returns the login page. Is there a way to allow the below code to work with Forms Authentication by whatever means, or do I need to create a new Web API project which uses Basic Authentication for this to work?
WebRequest req = WebRequest.Create("http://myurl/protectaction");
req.Credentials = new NetworkCredential("username", "password");
var res = req.GetResponse();
Thank you very much for your help,
Richard Hughes