Rest authorization

1
0
-1

Hi, I am trying to get list of process instances (or any other rest api data I can get) by making a XMLHttpRequest from Javascript. The loginservice request comes through, but when I try to get the process instances json, response is 401 unauthorized, because the cookie isn't set. Can you please tell me why is that? Just to mention, I tried the withCredential option because I can't manually set the cookie, but it doesn't work.

1 answer

1
0
-1

Hi

I have experienced a similar issue. The problem you're facing is CORS related ( CORS Wiki ). You probably serve the webpages from a server different from the webserver serving Bonita BPM? The only solution I have come up with so far is serving the webpages (i.e. your webpage and javascript) from the same webserver that hosts the Bonita BPM instance.

For example, if you're using Tomcat, you can just upload your webpage files into a folder in the webapps folder of Tomcat. This should work, I use this with Bonita BPM 7.0.0. to have custom webpages outside of the Bonita Portal.

Hope this helps. If you find another solution, please let me know.

Kind regards

Pieter

Notifications