Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle Jet Call Authenticated ADF Rest Using Ajax CORS ERROR

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

Comments

Which particular client did you install and how did you install it? Did you install the SDK?

cj
1 - 1

Post Details

Added on Apr 24 2021
1 comment
287 views