ped_sistemas's avatar
ped_sistemas
Frequent Visitor
7 years ago
Status:
New

PowerBI Embedded X-Frame-Options ERROR

Hi, I'm using powerbi-service-js to embed reports to my costumers in my Angular 8 application. Until October 3rd, everything worked fine. I would log in to the url (https://login.microsoftonline.com/common/oauth2/token) and then make a request to the powerbi API to get the report token. But now, when using pbiService's embed function, I get the following error. I'm using DirectQuery to construct the report and Deploying the Application in Nginx on Docker.

 

Refused to display 'https://app.powerbi.com/tokenRefresh?ver=1570488013252' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

 

ERROR DOMException: Blocked a frame with origin "https://app.powerbi.com" from accessing a cross-origin frame.
at e.retryTokenRefresh (https://app.powerbi.com/13.0.10956.175/scripts/reportEmbed.min.js:1:2245948)
at e.onTokenRefreshLoad (https://app.powerbi.com/13.0.10956.175/scripts/reportEmbed.min.js:1:2245770)
at HTMLIFrameElement.document.getElementById.onload [as __zone_symbol__ON_PROPERTYload] (https://app.powerbi.com/13.0.10956.175/scripts/reportEmbed.min.js:1:2245299)
at HTMLIFrameElement.ct (https://app.powerbi.com/13.0.10956.175/scripts/reportembed.externals.bundle.min.js:1199:9502)

5 Comments

  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    Icon for Community Support rankCommunity Support

    Hi ped_sistemas, 

     

    It looks like you are using a "secure publish to web embed mode" feature which has auto sign-in page part of the loading of embedded report then experience an issue accessing Power BI Embedded content. Right? 

     

    It's a known issue listed in Support site, you can keep an eye on the status of this issue in Support site: 

     

    Best Regards,
    Qiuyun Yu

  • I've been seeing it off on and on since Monday and wasn't able to find anything about it until now.  

     

    Thanks

  • Seems that the work-around only works for a period of time before the same problem re-occurs

  • Anonymous's avatar
    Anonymous
    Not applicable

    We have ran into the same issue in our NodeJS + ReactJS application. However, it seems to be working fine on our app that uses the .NET stack. Could someone please explain what is exactly causing this issue? Both of these applications use the same "powerbi-client" javascript library to embed report. The only difference is the backend technology uses to get the access token. I really don't understand why it works for one and not the other.

     

    I have tried to use the following node modules to embed the report and they both have the same issue

     - https://www.npmjs.com/package/powerbi-report-component

     - https://www.npmjs.com/package/react-powerbi

     

    I also tried to update powerbi-client https://www.npmjs.com/package/powerbi-client module to the latest version which is 2.10.1 and it is still the same.