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.
I'm developing a web app that will render embedded reports
* using PowerBI.com, NOT Azure Embedded
* ASP.NET MVC5 web application
* using powerbi javascript api
* intranet application using on-premise Integrated Windows Authentication
* Must support SSO
* all users will be Pro users
Trying to follow this ASP.NET sample (authenticate a web app) and translate to MVC5 however I can't get things to work.
* When user logs into my app (IWA)
* Get Authorization Code from AAD - this returns an HTML login page markup. Can't I use something in Microsoft.IdentityModel.Clients.ActiveDirectory for this?
* Get AAD AccessToken using code returned from above step to call AuthenticationContext.AcquireTokenByAuthorizationCode
* pass access token to view
* view uses token to initialize report via powerbi javascript api following steps here for PowerBI.com
Any help or insights on this would be greatly appreciated.
@jgermain wrote:
I'm developing a web app that will render embedded reports
* using PowerBI.com, NOT Azure Embedded
* ASP.NET MVC5 web application
* using powerbi javascript api
* intranet application using on-premise Integrated Windows Authentication
* Must support SSO
* all users will be Pro users
Trying to follow this ASP.NET sample (authenticate a web app) and translate to MVC5 however I can't get things to work.
* When user logs into my app (IWA)
* Get Authorization Code from AAD - this returns an HTML login page markup. Can't I use something in Microsoft.IdentityModel.Clients.ActiveDirectory for this?
* Get AAD AccessToken using code returned from above step to call AuthenticationContext.AcquireTokenByAuthorizationCode
* pass access token to view
* view uses token to initialize report via powerbi javascript api following steps here for PowerBI.com
Any help or insights on this would be greatly appreciated.
The demo on github from your link actually uses the name space Microsoft.IdentityModel.Clients.ActiveDirectory. What is your concern on this?
I don't know about MVC5, however embeding a report from Power BI.com can be as easy as using a static HTML. You just need to get the access token from backend.
<html> <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script> <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script> <script type="text/javascript"> window.onload = function () { var embedConfiguration = { type: 'report', accessToken: 'eyJ0eX....your token here', embedUrl: 'https://app.powerbi.com/reportEmbed?reportId=8067fc7f-06axxxxxxxxxxxxxx' }; var $reportContainer = $('#reportContainer'); var report = powerbi.embedNew($reportContainer.get(0), embedConfiguration); } </script> <div id="reportContainer" ></div> </html>
The issue is not with how to embed using javascript api once I have an access token. Rather, it's with obtaining the authorization code and/or access code from AAD after having successfully logged into my MVC5 intranet app via integrated windows authentication. In essence, I've authenticated against my local AD, but it's unclear how that SSO experience is carried through to AAD when requesting the authorization code or access token.
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 |
---|---|
15 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
26 | |
3 | |
2 | |
2 | |
2 |