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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.