Embedding not working

Hello Team,

I am using Helical Insight 5.2.1, and when we try to embed it via cross-domain, it is not working. Can you provide a solution for this issue? It seems to work in firefox, but for other browsers it is not working.

Pre-requisite : It is mandatory that your parent application (from where you want to integrate the reports) and Helical Insight application (where these reports are developed) are both on HTTPS (secure access).

In order to resolve this issue, please follow the steps carefully :

  1. Open the “context.xml” file from below Helical Insight installation path …/hi/apache-tomcat-9/conf

  2. Add below snippet. You can add towards the end also.
    < CookieProcessor className=“org.apache.tomcat.util.http.LegacyCookieProcessor” sameSiteCookies=“none”/>

  3. Open the file “web.xml” located at “…/hi/apache-tomcat-9/webapps/hi-ee/WEB-INF”.

  4. Uncomment the below lines which are by default commented. Uncomment them, these are required to enable cross-origin :
    <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,Accept-Encoding,Accept-Language,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Connection,Host,authorization</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.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>

  5. In the same web.xml file, search for the below text.

<param-value>Content-Type,X-Requested-With,Accept,Accept-Encoding,Accept-Language,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Connection,Host,authorization</param-value>

It has to be changed to below (Note that some additional parameters have also been passed which are : type,authToken):

<param-value>Content-Type,X-Requested-With,Accept,Accept-Encoding,Accept-Language,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Connection,Host,authorization, **type, authToken**</param-value>

  1. Similarly in the same web.xml file, search for the below content.

<init-param> <param-name>cors.exposed.headers</param-name> <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value> </init-param>

Change it so that it will become like below. (Note that some additional parameters have also been passed which are : Content-Disposition):

<init-param> <param-name>cors.exposed.headers</param-name> <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials,Content-Disposition</param-value> </init-param>

  1. Additional in this web.xml file, uncomment below to enable extra headers in cookies. By default these are commented. :
    <filter> <display-name>cookieFilter</display-name> <filter-name>cookieFilter</filter-name> <filter-class>com.helicalinsight.efw.filters.CookieFilter</filter-class> </filter> <filter-mapping> <filter-name>cookieFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>

  2. Save the web.xml file

  3. Restart Helical Insight service. Read this to learn how to restart Helical Insight service : Helical Insight not Running

This configuration ensures that cookies are sent with cross-origin requests and that older cookie handling behaviors are maintained.

Now Helical Insight cross domain embedding will also work. Make sure to delete browser history and check in private mode.

Thank You,
Helical Insight Team.