Chart embedding in React

How to embed a dundas bi chart in a React app. Has anyone worked with this? When I try to do this I get an error - The cookies required to operate are being blocked by the browser.

I get a logon token, I’m trying to insert a chart using the .create method
GetSession request returns 440 error
“The caller is not associated with a valid session”

Hi Vlad,

The problem you’re having shouldn’t be specific to React, but you may be facing browser-related restrictions or other general issues that could come up when embedding Dundas BI on another page. For example when embedding one page in another where they have different domains/origins, most browsers now require both to be served over HTTPS, and they can no longer be just HTTP unless they both have the same domain/origin. If you happen to be using a very old version of Dundas BI you may also need to upgrade since changes were made to correspond with browser changes over time.

Just to be clear, it sounds like you’re using the embed library’s create method to embed Dundas BI, and your chart is probably placed on a small dashboard and you are trying to embed that dashboard, or let us know if that’s not the case.

yes, I’m trying to embed a chart in my local React app. I use the create and load method. I am passing logon token and getting this error

I understand that this is due to the fact that I do not have tokens in the cookie

Dundas BI does rely on cookies, so your logon session will be lost if cookies are blocked or disabled by the browser or maybe by your server or a firewall. When cookies are not being blocked, you should just be able to pass the logonTokenId using either the embed library or a URL parameter, and the session should be maintained using cookies.

The most common reason for cookie-related issues when embedding is that browsers such as Chrome require that both pages be on the same domain, or if they are on different domains (cross-site) they must both must be served over HTTPS. If you are still having an issue, please tell us more about your scenario including whether you are using HTTP or HTTPS for each site, what version of Dundas BI you are using, and what browsers you’ve tried. You can also provide these details directly to Dundas Support instead.

What about authorization? To display the chart, do I just need to pass logOnToken to create method?

You can pass the logon token as the logOnTokenId property of the options object passed as the second argument to the create method, or set the logOnTokenId property on the application after creating it but before calling load. There is an example here that sets the property after calling create. I believe a logon token can only be used once and only immediately after getting it.

If you don’t provide a logon token, the user will see the logon screen to log on themselves unless you set up automatic logon.