Search code examples
asp.net-corepowerbiaccess-tokenpowerbi-embedded

Unable to get Access Token for PowerBI Embed


I am trying to embed the Power BI application to Angular Client. And have already done following stuff.

Created a Power BI report and deployed to a work Space using PowerBI pro license. Able to get the reportID and GroupId from URL.

Registered the APP in PowerBI app and in Azure AD, Provided the necessary permissions in the Azure AD

enter image description here

And to get the access token added following code:

enter image description here

And the app settings used like this:

enter image description here

However with the right username and password with what I have registered the Azure AD I am not getting the token.

enter image description here

Even though the API returned OK success I am getting this as response. I am not sure what I am missing here. I am using .net Core Application.


Solution

  • Use "https://login.microsoftonline.com/common/oauth2/token" (Token URL) instead of "https://login.windows.net/common/oauth2/authorize" (Authority URL).

    Update the URL in the following patch of code.

    Image

    Refer documentation for more information.