In general, we use session method to integrate Helical Insight reports and dashboards into a parent webapplication / product / website using iframe tab / object tag or embed tag. This method sends a token, creates session and fetches the required resources which is then shown in the parent application in which it is embedded.
Starting with Helical Insight version 5.2.1, a new embedding method is available that significantly improves performance and supports concurrent users. This is a sessionless method of embedding. With this no session is established, a request goes to Helical Insight application which provides those details.
This method offers numerous advantages
- As no session is established, hence the performance is better as there are no separate tomcat sessions gets established with every request. Hence performance wise and memory usage wise this method is better. With the other methods in which session gets established, with every user who goes to view reports/dashboard a session gets established and when logout happens then that session gets removed. These many sessions can crete performance issue.
- With earlier methods in which session gets established, manually we need to ensure that the session of Helical Insight is in sync with parent application (so that suddenly embedded reprots dashboard page of Helical Insight should not show expired page). Whereas there is no need to worry about such things here as no session gets established.
- This method is also more secure because there is no session established. Hence a user can never go and navigate to other pages even if he knows the embedded URL etc.
- There are some browsers who have strict security measures that block cross-domain integration request. However, this limitation can be overcome with the new sessionless integration method.
We will explain this process in detail and provide reference files for your convenience.
Prerequisites: Both Helical Insight and the parent application server (where you will render the reports/dashboards) need to be on HTTPS
Configurations to be done in Helical Insight application :
- Open web.xml from below Helical Insight installation path
…./hi/apache-tomcat-9/webapps/hi-ee/WEB-INF
- We should first uncomment the cross-origin snippet (from lines 63 to 91) and add the keys below in the specified positions (refer to the screenshot for exact placement).
Keys to be added :
type, authToken
Content-Disposition
- Uncomment the snippet below (lines 205 to 215) and save the file
2. Open “context.xml” from below Helical Insight installation path
…../hi/apache-tomcat-9/conf
Add below snippet
<CookieProcessor className=”org.apache.tomcat.util.http.LegacyCookieProcessor” />
- Restart Helical Insight service. To learn how to restart Helical Insight you can refer to https://forum.helicalinsight.com/t/helical-insight-not-running/1007
Steps to be followed in the parent application :
In this below example we are covering how we have created a sample code and implemented a sessionless embedding in it. Similar kind of steps you will have to follow in your frontend application in which you are embedding.
Please download embedding.zip using the following link : Download here
It contains index.html file which is responsible for listing all the reports and dashboards the user has access to and renders them when we click on it.
In case if you want to try out this example code with your Helical Insight, you can follow the steps mentioned below:
- BaseURL in line 14: You should provide the Helical Insight BI URL
var requestBaseUrl = “https://<hostname>/hi-ee/”
2. Lines 21 to 32: Supporting files should be loaded from Helical Insight. On all these lines also please replace <HOSTNAME> with your Helical Insight BI hostname.
3. In line 66, we should pass the SSO token, which we generate dynamically. You can read more about creating SSO tokens here (https://www.helicalinsight.com/implementing-single-sign-sso-helical-insight-application/)
var authToken = ‘xvKokiMu1t8kg1cpe5M6SUvwnotdpZihXZDehxUDjWIRHTWOv2MxLYItf1TKr9p1mVSxLrNS_6U4J5vofOprb5-s5V—yBEdQmo96SVjSk’
4. The main snippet to call embed is mentioned below;
embed({
auth: { type: ‘token’, authToken },
report: {
dir, file: name,
},
elementId,
baseURL: requestBaseUrl
})
- token: This is SSO token
- dir: This is Report/dashboard directory which you can find by going to that respective file in the file browser
- file: Actual report/dashboard File name
- elementId: ID of the div where you want to render these reprots/dashboard
- baseURL: Helical Insight URL
The logic is written in simple JavaScript; based on the technology used in your parent application, you can rewrite the logic accordingly.
We then deployed the index.html file on Tomcat to demonstrate the embedding process:
It lists all the reports and dashboards accessible to the user
When we click on a listed report or dashboard name, it renders as shown below
If you have any more questions regarding embedding or SSO etc, please reach out to support@helicalinsight.com