Forum Discussion
How to use Power BI Rest API without GUI authentication (redirect uri)
- 10 years ago
You can use the user name and password flow that AAD supports. This 3rd party client library has an example: https://github.com/Vtek/PowerBI.Api.Client
I did this by using the refresh token provided by the GUI authentication process and only using the AcquireTokenByRefreshToken method in my worker with the this token. I now just have to refresh the RefreshToken after a few days and update the configuration of my cloud worker (stored in redis -> worker checks for updated token). I do not re-use the Refresh Token in the configuration for every authentication request though but the new ones provided by AcquireTokenByRefreshToken.
aevers what you say makes sense, but how do you refresh the token after a few days? Have you automated this?
My app doesn't use Active Directory so I will want a single account setup and to silently authenticate to display the report to a certain set of users.
I was thinking that the Active Directory REST api might be another option, but I've not used it before and just reading into it.