I have two applications
1- ADF BC Rest Services Application and ADF Security is applied,
2- Oracle JET Application
I have called a login service from adf app using username and password and it returns JSESSIONID, which i saved on cookie to use it again to call rest services without username and password.
i used this ajax call on the second call :
$.ajax({
type: "GET",
url: "http://127.0.0.1:7101/hr/rest/v0/Employees",
contentType: "application/vnd.oracle.adf.resourceitem+json",
crossDomain: true,
headers: {
"Cookie": "JSESSIONID=" + app.getCookie("SID"),
},
success: function (data) {
console.log(JSON.stringify(data));
},
error: function (xhr, textStatus, errorThrown) {
console.log(errorThrown);
},
});
But it returns these errors:
Refused to set unsafe header "Cookie"
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
I have enabling cors on adf web.xml.
So i Don't know how to solve this.
I just need to know how call authenticated rest using jsessionid ?
Thanks