ngBonita CORS issue
I have two tomcat instances running. One has bonita server running and on the other i have my grails application. I am trying to use ngBonita - Angularjs api for the client. I am running into CORS issue. I setup tomcat for CORS and also set up headers to allow all. I have little success but still seeing issues. any help ? on chrome console i see the following messages
BonitaAuthentication.login success
mydns/:1 XMLHttpRequest cannot load https://mydns:8446/bonita/API/system/session/unused. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://mydns:8443' is therefore not allowed access.
mydns/:1 XMLHttpRequest cannot load https://mydns:8446/bonita/API/system/session/unused. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://mydns:8443' is therefore not allowed access.
Bonita 6.5 java 1.6 tomcat 7.0.55 for bonita and tomcat 7.0.52 for my client application
Comments
did you set up your tomcat for CORS ? see link here
add cors-filter jar to tomcat/lib folder. cors filter jar has a dependency on java property utils jar. add that as well. add the following to tomcat web xml
<param-name>cors.allowGenericHttpRequests</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>cors.allowOrigin</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>cors.allowSubdomains</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>cors.supportedHeaders</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>cors.supportsCredentials</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>cors.maxAge</param-name>
<param-value>3600</param-value>
</init-param>
<filter>
<filter-name>CORS</filter-name>
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
<init-param>
<param-name>cors.supportedMethods</param-name>
<param-value>GET, HEAD, POST, PUT, DELETE, OPTIONS</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CORS</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Hi ,
I have the same problem , can you tell me how i can to add cors-filter.
thanks in advanced.