Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a rest application with Power BI. I upload a dataset and generate a report.
After the report is uploaded I would like to show the user the report. They have already authenticated to use my REST code... and I have that bearer. Is there any way to show the report without prompting the user to authenticate again?
Solved! Go to Solution.
Hi @CamStillHere ,
To summarise the steps for hte implicit grant flow with Power BI Embedded and the REST APIs:
If I understand correctly you have already implemented the first 5 steps and you only need to implement step 6.
-JP
Hi @CamStillHere ,
Assuming your users already having PowerBI Pro licenses in that case, you can use the PowerBI Embedded - User owns data
Sample Code for the reference: https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/User%20Owns%20Data
Here you are using PBI JS to embed your pbi reports using the end users bearer token
This is helpful however looks to require IIS?
Is there a way to embedded it for example in an app that only has a browser (and can send headers along with the browser navigate request)
If this does work without IIS/some sort of hosted solution - is there steps?
Hi
Both App owns data and user owns data require Web Server like IIS
Other option is to use Secure Embed : This option help you to embed in any of the apps (don't need any IIS) there are some limitations
Limitations:
Not sure you can override the autentication and provide the bearer token with this option.
Thank you! That's a wealth of information.
Unfortunately for me I'm using an application (java) that is using a jxbrowser (embedded browser) so native authentication like sharepoint etc don't work. The user is prompted as if in incognito.
The other feedback is great too.
I'll leave this question open because I'm still wanting to know about using the API bearer token to load the report in some way. If I don't get an answer I'll mark yours as accepted as it's the best I've got in multiple forums so far.
Hi @CamStillHere ,
Do you have any update for your question? I'm happy to hear from you , to close this thread !
Unfortunately I don't have an update as I can't raise a ticket to microsoft and I haven't got an answer here as yet.
For my solution I ended up calling the browser and prompting the user to sign in (for a second time) which is a bit cumbersome but it is avoiding the problem for now. I would love to open the report with just the bearer token and I can't find a way that does this.
Hi @CamStillHere ,
As long as your bearer token is identifying an AAD user, you can use that token with the REST APIs and to get an EmbedToken to embed a report in your application.
You can take a look at the documentation of creating an SPA application (https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-spa-overview) with an Implicit Grant authentication schema and that usertoken you can re-use for both parts: REST API and Embedding the report.
-JP
Could you elaborate please. The answers above suggest that workflow you have mentioned would require hosting somewhere... To be clear I'd like to purely use the REST API for power bi, and load the report with that bearer.
HI @CamStillHere ,
Big advantage of an SPA is that it doesn't need any server-side code and it can run completly in the scope of the user, like a browser with JavaScript.
-JP
Thank you again, but could you elaborate the workflow to get that working?
Hi @CamStillHere ,
To summarise the steps for hte implicit grant flow with Power BI Embedded and the REST APIs:
If I understand correctly you have already implemented the first 5 steps and you only need to implement step 6.
-JP
User | Count |
---|---|
15 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
18 | |
11 | |
5 | |
4 | |
3 |