Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |