The "Error: A Security problem occurred" is probably from your script, which is hiding the real issue. Can you share your script or any there any logs, or do you have access to any http traffic monitoring tools (like Wireshack) to see which requests are failing?
Thank you for your hint.
I developed a simple HTML page using the script and everything worked fine.
Using the exactly same script from a Microsoft Office Web Add-in still returned me an error: in the end it turned out that the problem was caused by the Office Add-in using SSL.
For completeness, here is the script that is working correctly:
var serviceUri = "http://Server/odata4/VDB/Model/Entity?$format=JSON";
$.support.cors = true;
$.ajax({
type: 'GET',
url: serviceUri,
dataType: 'json',
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Basic " + btoa("User:Password"));
},
success: function (data) {
$.each(data.value, function (index, element) {
$('body').append($('<div>', {
text: element.EntityName + ', ' + element.EntityDescription
}));
});
},
error: function (exch) {
errorHandler(exch.statusText);
}
});