Quantcast
Viewing all articles
Browse latest Browse all 17897

Issue while generating Embed token with ClientID and login credentials using EmbedApiSample

My requirement is to use the PowerBI embedded to show the .pbix reports in a angular web application.

I'm getting the following error when I try to run this app (https://github.com/guyinacube/Embed-API-Sample) to create Embed token (as specified in the video https://www.youtube.com/watch?v=GPHHdDRSlis&list=PLv2BtOtLblH2Rm9trJPuxmN8Kr8WFv7O0&index=7). The console application is crashing when it is trying to authenticate the credentials.

{"AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion'.\r\nTrace ID: 4de61335-1397-4912-ba59-62986ddc6200\r\nCorrelation ID: c7a41f92-4279-45c5-8ecf-f67dbb85d225\r\nTimestamp: 2018-04-23 15:20:09Z"}

It is breaking with the above exception when it executes the line

 authenticationResult = await authenticationContext.AcquireTokenAsync(resourceUrl, Secrets.ClientID, credential);

I Registered my application with the Power BI App Registration Tool in the link https://dev.powerbi.com/apps

I provided the following details during registration:

App Type:
    Server-side Web app
Redirect URL:
    http://localhost:4200/main/homepage
Home Page URL:
    http://localhost:4200

After registering the application with above details, I got both Client ID & Client Secret. In the console I could provide the ClientID, my login credentials, but not able to provide Client Secret. When I execute the application and during the authentication the application is crashing.

Why I am getting this error? How to generate the Embed token?


Viewing all articles
Browse latest Browse all 17897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>