cancel
Showing results for 
Search instead for 
Did you mean: 

configuration of CORS for Service Layer

christopher_brown3
Discoverer
0 Kudos

This question is to do with the installation and configuration of Service Layer. Is CORS enabled such that REST requests from the CFG Website can work?
We have issues with authentication from the Web API. In fact so far we have not managed to get this to work. I had originally thought the problem was to do with .Net however I have also repeated the issues using JQuery.

This is the error we get from Firebug:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ……

Here is a sample of the JQuery we are using.


$(document).ready(function(){
$("button").click(function(){
$.ajax({
url:"https://xxxxxx.org.uk:50000/b1s/v1/Login",
crossDomain: true,
dataType: "json",
headers: {
"Host": "https:// xxxxxx.org.uk:50000",
"Content-Type": "application/json; charset=utf-8",
"Cache-Control": "no-cache"
},
data:{ CompanyDB: "TEST",
UserName: "xxxxxxx",
Password: "xxxxxxxx"
},
})
})
});

What we want to achieve is running from our Web site .Net code to perform CRUD via the Service Layer for on-line purchases. We have using Postman managed to authenticate and do other CRUD action. Unfortunately we just can’t get this to work from code.

Any advice that points us in the right direction will be welcome

Accepted Solutions (0)

Answers (0)