I need to make an API call to my .NET 4.5.1 application that uses Windows AD for authentication. Making the call via Dojo/Request and Esri/Request, I am returned with a UNAUTHORIZED response code. I need to find the correct syntax for passing Username and Password to an API endpoint which uses Windows AD.
esri/Request (returns UNAUTHORIZED):
var requestHandle = esriRequest({
"url": "https://myWindowsADwebsite.net/api/contact/get"},
{headers : {"Username": "myUser", "Password": "myPass" }
});
requestHandle.then(this.requestSucceeded, this.requestFailed);
Dojo/Request (returns UNAUTHORIZED):
request("https://myWindowsADwebsite.net/api/contact/get/", {
headers: {
"Username": "myUser",
"Password" : "myPass"
}
There is a way to pass credentials to a Windows AD endpoint, but it is not via the headers based on what I have tested. All help is appreciated.