Forum Discussion
Problem embedding report - "This content isn't available"
- 8 years ago
I'm going to wrap this up by clarifying my use case and explaining what I did to work around my issue. First of all, I'm following the "User Owns Data" scenario, or "embedding for your organization" depending on what documentation you're looking at. The goal is not to use a master account to authenticate, but rather for the end user to authenticate with his/her account and then be presented with the content that they are authorized to view. I'm building a custom portal to improve upon the user experience provided by powerbi.com, and adding metadata features in the process.
The main factor with my issue turned out to be the fact that I was opening a new browser window in order to display the embedded report/dashboard. I never discovered why that poses a problem, but I have successfully worked around the issue by instead displaying the embedded content in an overlay that takes up the full browser window. The only properties that I need to pass into the config object to the powerbi.embed function are type, accessToken, and embedUrl. I don't have to deal with embed tokens at all to make this work.
I will also mention that I had a very frustrating experience dealing with Microsoft tech support on this issue, so I'm happy to clarify anything about my solution for people that might stumble upon this post. I opened a support incident through my MSDN account, and ended up spending many hours over the course of several weeks providing diagnostic information to the Power BI product team. They really never did anything for me except ask me to jump through lots of hoops, which I did, and it never got me an answer to my question about why I got an error when embedding the content in a new browser window.
Gotcha - if you're using a single "master" account to authenticate your application (i.e. not going the adal.js route described above), then yep, you should be requesting an embed token, and "models.TokenType.Embed" is the correct setting.
An embed token is, as you've surmised, distinct and separate from the authentication token you've already acquired. In short, the authentication token describes what you have permission to see, while the embed token grants specific permission to load content you can see outside of the Power BI application.
Had to dig a while to find this, but specific requests and call parameters for each type of embed token are documented here:https://msdn.microsoft.com/en-us/library/mt784614.aspx (it was last updated in October 2017, so it should still be accurate).
Full disclosure: my team hasn't tried this approach yet (we'll likely shift to it in the coming months, hence my interest in your question). Let me know if it works?
Thanks again for sharing what you know, discjosh1dp. I'll definitely keep you posted as to how this resolves. I just opened a suport ticket with Microsoft yesterday because the trial and error approach is wearing me down.
My workflow is different from what you describe. The idea is not to authenticate with a master account. Rather, each user authenticates to our Azure AD instance as themselves, and they see whatever content they are authorized to see by virtue of the workspaces (AD groups) that they are a member of. I don't know if that warrants an embed token or not but I'll find out from the authorities.
FYI, the link you shared in your last post doesn't work when I click on it but I can reach the page if I copy/paste the URL shown. I see a trailing space in the href attribute. Maybe that's the problem?