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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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