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
James_kyndryl
New Member

Is there any way to embed power bi report without using Azure AD

Hi,

I am not sure I am in the right channel to ask question, please advise if I am in the wrong channel, thanks.

My background is that I am learning how to embed Power BI report in my React web applicaiton, and I try to use this node package "powerbi-client-react" in my application to embed report, and I try to find any solutions for this config param "accessToken", and almost all the experts in Youtube videos said that they use Azure AD for the identity authentication, I want to know is there a way for my project to embed report without using Azure AD.

 

For accessToken, I copy it manually by chrome console script copy(powerBIAccessToken) in powerbi.com workspace.

and I try to use this api to get embedUrl and token but always response me 403 code

My code FYI:

 

import React from 'react';
import { PowerBIEmbed } from 'powerbi-client-react';
import { models } from 'powerbi-client';

const Dashboard = () => {
  const embedConfig = {
    type: 'report',
    id: '964645...b0a41f8',
    embedUrl: 'https://app.powerbi.com/reportEmbed?reportId=9646...0a41f8&groupId=8f7802...857d103&w=2&config=eyJjbH..X19',
    accessToken: 'eyJ0eXAiOiJKV1Q...hwKuQ', 
    tokenType: models.TokenType.Embed,
    settings: {
      panes: {
        filters: {
          expanded: false,
          visible: true
        }
      },
      background: models.BackgroundType.Transparent,
    }
  };

  const eventHandlers = new Map([
    ['loaded', function () { console.log('====Report loaded'); }],
    ['rendered', function () { console.log('====Report rendered'); }],
    ['error', function (event) { console.log(event.detail); }]
  ]);

  const getEmbeddedComponent = (embeddedReport) => {
    window.report = embeddedReport;
  };


  return(
    <PowerBIEmbed
      embedConfig={embedConfig}
      cssClassName = { "report-style-class" }
      eventHandlers = { eventHandlers }
      getEmbeddedComponent = { getEmbeddedComponent }
    />
  );

};

export default Dashboard;

 

 

 

 

 
 

 

 

2 REPLIES 2
Anonymous
Not applicable

Hi @James_kyndryl ,

You can refer the following official documentation to embed Power BI item into React application:

Bootstrap a component

embedConfig = {
    {
        type: 'report', // Supported types: report, dashboard, tile, visual, and qna.
        id: undefined,
        embedUrl: undefined,
        accessToken: undefined, // Keep as an empty string, null, or undefined.
        tokenType: models.TokenType.Embed
    }
}

Best Regards

Hi Rena, thanks for your answer, but the code snippet you pasted here is just a demostrate. but I want to know how to get all the params of embedConfig, especially accessToken, I dont want to get this from Azure AD, I want to get it in another way.

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.