Reply
Highlighted
Frequent Visitor
Posts: 19
Registered: ‎08-08-2017
Accepted Solution

POST 403(forbidden) after dashboard has been embedded

I'm using an app owns data setup with power BI embedded and have added functionality for switching between and refreshing dashboards. However after the first embed of a dashboard i am confronted with 4 POST 403 errors in chrome console and after this any refresh or switch just leaves a blank dashboard. below is an image that is representative of what is in the console after the first embed:

To be clear the first embed works fine and the dashboard is visible as expected but any subsequent attempts to change or refresh leave me with a blank screen


Accepted Solutions
Frequent Visitor
Posts: 19
Registered: ‎08-08-2017

Re: POST 403(forbidden) after dashboard has been embedded

So its a little bit of a hack but i managed to get rid of the unauthorized errors by doing embedURL.replace("https://app", "https://msit") still unsure why requesting the url feeds back app but hey this got rid of the errors. However this hasnt actually changed the fact that running powerbi.embed again leaves me with a blank dashboard instead of refreshing like it does for reports. At this point I have given up on automatic refreshes for dashboards. switching between dashboards works now at the very least so I'm going to mark this as the solution unless anything better is posted.

View solution in original post


All Replies
Moderator
Posts: 3,051
Registered: ‎03-06-2016

Re: POST 403(forbidden) after dashboard has been embedded


@daveParso wrote:

I'm using an app owns data setup with power BI embedded and have added functionality for switching between and refreshing dashboards. However after the first embed of a dashboard i am confronted with 4 POST 403 errors in chrome console and after this any refresh or switch just leaves a blank dashboard. below is an image that is representative of what is in the console after the first embed:

To be clear the first embed works fine and the dashboard is visible as expected but any subsequent attempts to change or refresh leave me with a blank screen


@daveParso

I'm not able to produce this issue. To exclude the cause from your code, could you try to embed with the attached html file? If the error still exists, please fiddler the network traffic when refreshing and submit a support ticket with the trace file.

Attachment
Frequent Visitor
Posts: 19
Registered: ‎08-08-2017

Re: POST 403(forbidden) after dashboard has been embedded

[ Edited ]

So the embed worked fine in the attached html file. The one difference i noticed between the two was i was using https://app.powerbi.com/dashboardEmbed? in my embed url where as the html file you provided used https://msit.powerbi.com/dashboardEmbed? However if I modify my embed url to include msit instead of api I get "an invalid status code NotFound". Its also curious to me that my report embedding works just fine with app without throwing the error that dashboards are.

 

Edit:

After some more digging i have found that using dashboard.embedUrl in the controller is returning the https://app.powerbi.com link however if i replace this by hardcoding in the msit one it works fine. as far as im aware though i dont have any control over what that value is so is there some way for me to change this as obviously hardcoding in what dashboard is displayed is not suitbale for the overall product.

Frequent Visitor
Posts: 19
Registered: ‎08-08-2017

Re: POST 403(forbidden) after dashboard has been embedded

So its a little bit of a hack but i managed to get rid of the unauthorized errors by doing embedURL.replace("https://app", "https://msit") still unsure why requesting the url feeds back app but hey this got rid of the errors. However this hasnt actually changed the fact that running powerbi.embed again leaves me with a blank dashboard instead of refreshing like it does for reports. At this point I have given up on automatic refreshes for dashboards. switching between dashboards works now at the very least so I'm going to mark this as the solution unless anything better is posted.