Hi,
We have a simple application that calls a search query over a HTTP call. Prior to that we need to authenticate and the examples I have seen are utilizing Basic Authentication but how about Windows Integrated Authentication and OTDS? Looking at the help section for OTDS and "Single Sign On with Integrated Windows Authentication" (Figure 11-4) it states "In this scenario, Integrated Windows Authentication is used. There is no form to post. Directory Services handles the Kerberos/NTLM token. The resource does not need to be Kerberos-enabled.".
Anyone that have implemented this in a good way that can share his/hers findings or is the example utilizng Basic authentication the way to go? How about using HttpClient in stead of the old HttpWebReques?
Examples found in KC:
HttpWebRequest loginRequest = null;
HttpWebResponse loginResponse = null;
//Create the HttpWebRequest object to log the user in. Set the correct hostname and path for your environment in the URI object.
loginRequest = (HttpWebRequest)HttpWebRequest.Create(new Uri(Settings.Default.ContentServerURL));
//Set up the POST data. User credentials can be adjusted as needed.
var postData = "func=ll.login";
postData += "&Username=" + Settings.Default.CSSearchUserAccount;
postData += "&Password=" + Settings.Default.CSSearchUserPassword;
var loginPost = Encoding.ASCII.GetBytes(postData);
//Set up the required request parameters for the login POST.
loginRequest.ContentLength = loginPost.Length;
loginRequest.ContentType = "application/x-www-form-urlencoded";
loginRequest.Method = "POST";
loginRequest.CookieContainer = CC;