Accessing REST api flowNode

I'm trying to use the redirectNextTask widget on a form and everything worked fine until I deployed the process on a testing server. On the testing server, everytime I open the task and the form gets loaded, the page gets redirected. After some debug I found that the problem was that when the script inside the redirectNextTask widget was calling the rest api /bonita/API/bpm/flowNode/16 (16 is an example) I get an HTTP ERROR 403 (forbidden access).