Forum Discussion
vai1sf
2 years agoRegular Visitor
Embed report using react-powerbi-client ends with 403
Hello, I'm new to PowerBi and I'm the React developer who consumes the PowerBI report, developed by other team. My goal is to embed a report into our portal and filter it. I'm granted view perm...
- 2 years ago
UPDATE: Incorrect embedtoken type is used, should be
models.TokenType.Aad
Hari000
1 year agoNew Member
I am also facing the same issue, I am using App Owns Data concept,
I am following this blog post to generte the embed token
https://medium.com/globant/how-to-embed-a-power-bi-report-in-react-f27e975e0a
I am able to generate the token but the report is not showing in my front-end, and this is my reactjs code
import { PowerBIEmbed } from 'powerbi-client-react';
import { models } from 'powerbi-client';
function Dashboard() {
return (
<div>
<PowerBIEmbed
embedConfig={{
type: 'report',
id: 'xxxxxxxxxxxx',
embedUrl: "my embed url",
accessToken: "my access token",
tokenType: models.TokenType.Aad,
settings: {
panes: {
filters: {
expanded: false,
visible: false
},
},
customContextMenu: false,
}
}}
eventHandlers={
new Map([
['loaded', function () { console.log('Report loaded'); }],
['rendered', function () { console.log('Report rendered'); }],
['error', function (event) { console.log(event.detail); }]
])
}
cssClassName={"Embed-container"}
getEmbeddedComponent={(embeddedReport) => {
window.report = embeddedReport;
}}
/>
</div>
);
}
export default Dashboard;