Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Whenever i am trying to embed my Power Bi report into my webapp deployed on a local server , i am getting 403 error
I am using the below code to get access token
var config = { tenant: 'tenant id here', clientId: 'client id here', redirectUri: 'http://localhost:8080/PowerBiApp', navigateToLoginRequestUrl:false, }; var authContext=new AuthenticationContext(config); var hash = window.location.hash; if(hash.length!=0){ authContext.handleWindowCallback(hash); var user=authContext.getCachedUser(); } function login(){ authContext.login(); } function acqureToken(){ authContext.acquireToken("https://graph.microsoft.com", function(error, token, message){ console.log(token) }) }
After that i am usng this token to embed the report, below is the code to embed the report
window.onload = function () { var embedConfiguration = { type: 'report', accessToken: 'token here', embedUrl: 'https://embedded.powerbi.com/appTokenReportEmbed?reportId=feb96c19-cad7-478a-934d-2e647f98a4ff' }; var $reportContainer = $('#reportContainer'); var report = powerbi.embed($reportContainer.get(0), embedConfiguration); report.fullscreen(); }
but i am always getting 403 error
Can someone help ?
Solved! Go to Solution.
Hi amol9372,
Seems like something wrong with the authentication, please check if the access token is expired, also check if the app workspace has been assigned to a capacity. For more details, please refer to: https://docs.microsoft.com/en-us/power-bi/developer/embed-sample-for-customers#create-a-dedicated-ca....
Regards,
Jimmy Tao
Hi amol9372,
Seems like something wrong with the authentication, please check if the access token is expired, also check if the app workspace has been assigned to a capacity. For more details, please refer to: https://docs.microsoft.com/en-us/power-bi/developer/embed-sample-for-customers#create-a-dedicated-ca....
Regards,
Jimmy Tao
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
96 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |