Azure-Samples / powerbi-dotnet-server-aspnet-web-api

PowerBI sample demonstrating use of C# SDK for creating embed REST API
MIT License
9 stars 6 forks source link

Error when calling report.load, "accessToken is required" #3

Closed mattmazzola closed 8 years ago

mattmazzola commented 8 years ago

The current code is using both a direct call of powerbi.embed() before the DOMContentLoaded event and an indirect call using powerbi.init() after DOMContentLoaded.

The second call through powerbi.init() will internally cause call to embedExisting since there is a report already embedded in the element which then requires the configuration to be passed explicitly. This defaults to an empty object which does not have an accessToken and this fails validation.

image

mattmazzola commented 8 years ago

Accidentally created this issue on wrong repo. Auto-correct on the url got me.