Hi
I have a dynamics crm 2013 development enviroment with a organization running with ADFS.
I try to locally develop a JS site that i later will embed in the crm using an iframe. Somehow, whenever i try to call the crm service (to retrieve some date) i get an unathorized error. This is my jquery request:
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
datatype: "json",
url: OdataEndpoint + "/" + entityName + "(guid'" + id + "')",
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader("Accept", "application/json");
},
success: function (data, textStatus, XmlHttpRequest) {
if (successCallback) {
successCallback(data.d, textStatus, XmlHttpRequest);
}
},
error: function (XmlHttpRequest, textStatus, errorThrown) {
if (errorCallback)
errorCallback(XmlHttpRequest, textStatus, errorThrown);
else
errorHandler(XmlHttpRequest, textStatus, errorThrown);
}
});
}
}
The odata endpoint url looks like this:
https://org.domain.com/XRMServices/2011/OrganizationData.svc/myentitySet(guid'%7B0111AAE5-74CC-E311-93F8-E41F13BE2EFC%7D')
I also tried to call the internal url or the ip itself. With IE i get the 401 and with Chome and Firefox i even get a 404 (not found). When i open the url directly in the browser, it works perfectly an i get a response.
Any ideas?
Kind regards
Daniel