I've a client application that contains mostly the front end code. For example in the login screen a remote api is called to authenticate the user against a database. This works fine in forms authentication but when basic authentication is implement i get
401 error. The sample code is as below. Kindly help.
in logincontroller
string data = JsonConvert.SerializeObject(loginUser);
cookie = RemoteData ("/authenticateuser", "POST", data);
private string RemoteData(string url, string Method, string data) {
string result = "";
var wi = (WindowsIdentity)HttpContext.User.Identity;
var wic = wi.Impersonate();
try
{
using (var client = new WebClient { UseDefaultCredentials = true })
{
client.Headers.Add(HttpRequestHeader.ContentType, "application/json; charset=utf-8");
byt ...
Go to the complete details ...