Introduction:
CORS is a mechanism that allows restricted resource on a web page to be requested from another domain outside the domain from which the first resource was served.
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
Enable CORS in jasper:
- Add the CORS properties in web.xml file in Jasper Server
- Add Remote Domain Header in cors.allowed.headers in cors filter properties
- Add withCredentials property and Remote Domain property in Ajax call
...\apache-tomcat\webapps\jasperserver-pro\WEB-INF
Reference Link: http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#CORS_Filter
To pass credentials to cross-domain Reference: http://api.jquery.com/jquery.ajax/ xhrFields: { withCredentials: true } To allow CSRF protection Reference:https://community.jaspersoft.com/documentation/tibco-jasperreports-server-security-guide/v630/configuring-csrf-protection headers: { "X-Remote-Domain": "1" }
CORS Properties:
<filter> <filter-name>CorsFilter</filter-name> <filter-class>org.apache.catalina.filters.CorsFilter</filter-class> <init-param> <param-name>cors.allowed.origins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>cors.allowed.methods</param-name> <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value> </init-param> <init-param> <param-name>cors.allowed.headers</param-name> <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,X-Remote-Domain</param-value> </init-param> <init-param> <param-name>cors.exposed.headers</param-name> <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value> </init-param> <init-param> <param-name>cors.support.credentials</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>cors.preflight.maxage</param-name> <param-value>10</param-value> </init-param> </filter> <filter-mapping> <filter-name>CorsFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
In case if you have any queries please get us at support@helicaltech.com
Thank You
Rupam Bhardwaj
Helical IT Solutions Pvt Ltd
Best Open Source Business Intelligence Software Helical Insight Here
A Business Intelligence Framework
Best Open Source Business Intelligence Software Helical Insight is Here