CORS issue on Camunda Embedded Form Requests

Fairly New to Camunda and working with a combination of embedded forms and service tasks on a given process…

I am R=running into CORS issues on the Embedded forms that are using AngularJS to make calls to custom restful end points. However, i’ve been running in to this error:

Access to XMLHttpRequest at 'http://localhost:8015/SOMEENDPIONT' from origin 'http://localhost:8080' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'http://localhost:8008' that is not equal to the supplied origin.

At the time I found a small work around by making changing the .bat file and server.xml in the conf folder to point to port 8008 on my local machine. However, a problem arises when I’m listening in on tasks that are executing via a (rest service using - camunda-external-task-client-js) with logging enabled i’m getting the error :

camundaClient.subscribe("TASK-THAT-EXECUTED", async function ({task,taskService}) {
  console.log('TASK HIT')
  await taskService.complete(task);
});

results in:

polling failed with undefined

By trial and error when i’ve reverted Tomcat server settings and the .bat file to point to port 8080 again, and the issue with the listening on tasks has gets resolved with log outputs showing normal polling behaviour.
But the CORS issue with embedded forms arises upon switching back to port 8080.

Any Ideas for a solid way to work this out. thanks

That’s not really related to the camunda. That’s a security measure in the browser preventing cross-site scripting. You need to configure your other application serving your “custom restful end points” so that it allows it’s resources to be shared with cockpit app. If it’s a spring app, check this: https://spring.io/guides/gs/rest-service-cors/#_enabling_cors

you need to add ‘Access-Control-Allow-Origin’ header value as http://localhost:8015/SOMEENDPIONT