Hi, I want to embed our dashboard via <iframe&g...
# gd-beginners
n
Hi, I want to embed our dashboard via <iframe>, but I met a DOMException issue which from accessing a cross-origin frame. Is there any solution for this problem?
m
Hi Neal, you may need to enable CORS to get around the same-origin browser restrictions. Can you please give this a go and see if this helps? You can also refer to the following documentation for more details: https://www.gooddata.com/docs/cloud/embed-visualizations/iframes/embed-analytical-designer-via-iframe/
n
Thank you Michael! Problem solved! But a new problem came out! I use <iframe> to embed the dashboard to our own website. The src I am setting is url/dashboards/embedded/#/workspace/<workspaceID>/dashboard/<dashboardID>. but the event listener never catch a event with name listeningForApiToken or apiTokenIsAboutToExpire. Also, I am using JWT token, but the generated tokens are hair long, unlike what you showed our your guide pages. But yeah, the main problem is why event listener only receives event with name "platform" but no apiTokenIsAboutToExpire or listeningForApiToken?
m
You mention - The src I you’re setting is:
Copy code
url/dashboards/embedded/#/workspace/<workspaceID>/dashboard/<dashboardID>
So you’re they’re just missing this in the embedding URL:
Copy code
?apiTokenAuthentication=true