External Access + Web API

Hi Team,

I need to publish a charts and maps created in DHIS, and these should be published in a external portal, but the “same-origin policy” don´t allow it. I know that “setup a authenticating proxy with nginx” is the most recommended, even so, I have some question that maybe you can solve or sharing their experience.

  1. I tried using CORS with angulajs and enabled tomcat for allow cross-origin(Apache Tomcat 7 Configuration Reference (7.0.109) - Container Provided Filters), but all my testing were failures. the response always is “XMLHttpRequest cannot load The request was redirected to ‘;jsessionid=C9EA7CCE823094EBE0531FA19F03ADC2?failed=true’, which is disallowed for cross-origin requests that require preflight.”. Someone have some example working and the configutation of tomcat?.

  2. I understand that since version 2.14 is possible sharing charts, maps etc. for external access without authentication, but in the documentation I don´t find information about it, I tried sharing the dashboard but this don’t worked o perhaps i am using wrongly the webAPI .

  3. What Is the appropriate way to setup a authenticating proxy with nginx and how these work with DHIS API? (Some example?).

In my case I am more interested in the two first solutions or in the third if the others don’t are a functional solution. I attached my sourcecode.

best regards

MG. Helder Yesid Castrillon.
Secretaría departamental de salud del Cauca (Colombia)

CorsEJemplo.html (2.3 KB)