0
votes

How, in javascript, can you authenticate to Power BI Rest API without registering an app in AAD? So person from an app would provide credentials and could f.e. export some reports, refresh datasets. 

Tutorials and docs first point is to register an app and get at least clientId. But example PowerShell scripts with Login-PowerBI (Connect-PowerBIServiceAccount) function let you in after filling login popup. The same is when using api documentation 'TryIt' button. I'd like to do this in javascript, but I don't quite know what scenario happens there. 

In documentation 'Get an Azure AD access token for your Power BI application' https://docs.microsoft.com/en-us/power-bi/developer/embedded/get-azuread-access-token  there are scenarios 'User owns data' and 'App owns data', but both want registering an app. What am I missing? 

1

1 Answers

1
votes

PowerBI authentication needs AAD and if you application user AAD as single sign-on you should have access to PBI.

Take a look at this doc:

https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/what-is-single-sign-on

When Powershell pops the auth box, it creates an authenticated session.