Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
pallaccio
Regular Visitor

Embed report in web app displayable only with token

I guys,

 

I would like to embed some reports uploaded on my Power BI Workspace in my web application based on Spring MVC (Javascript based front end). I read about several custom solution but I have some dubts. 

 

I tried to embed my reports with the simple snippet code getted in Power BI Embedded Playground, using the Javascript SDK (powerbi.js), and it work perfectly.

var config = {
    type: 'report',
    tokenType: tokenType == '0' ? models.TokenType.Aad : models.TokenType.Embed,
    accessToken: 'UzI1NiI...sIng1dC',
    embedUrl: 'https://app.powerbi.com/view?r=JiO....YzkzZ',
    id: 'f04...d71d',
    permissions: permissions,
    settings: {
        filterPaneEnabled: true,
        navContentPaneEnabled: true
    }
};


The problem is wich in JS anyone can take the URL and visualize the report's data without use the token or the report ID. 

 

So, following the guide, I saw that I can use an Azure app to use an API Rest to authenticate the user and get a token for show the report. But there is a tutorial that explain this?

 

In simple terms I would like to get a valid token calling the Power BI Rest API (Java) and use that to embed a report througth Javascript SDK. Meanwhile I created an Azure App and I've got some reports in my Power BI Workspace, but I don't know how to connect them to be able to use the API and the JS SDK together. At the same time I would like to allow to show the report only from my web app, to prevent users not logged in, they can view the report, even with the URL.

 

Thank you in advance!

 

 

0 REPLIES 0

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.