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.
- seijim11 years ago
Microsoft Employee
Thanks for your suggestion.
I will try it.
- salesavlino10 years agoNew Member
Did the suggestion provided by him worked for you. Because i feel the suggestion provided is not relavant to the one you asked. He mentioned as "using the refresh token provided by the GUI authentication process" but as per my understanding its not the question you asked. I guess asked not to redirect to the loginpage, instead it should authenticate silent through code and get the "code" parameter in turn.
- seijim10 years ago
Microsoft Employee
Thanks for your message.
Actually his answer doesn't completely adapt to my requirement in the point of GUI less.
But that's an useful workaroound.
Azure Stream Analytics (ASA) also requires Web GUI authentication on management portal when we select Power BI output.
I've been thinking that his workaround is an only solution because ASA behaves so.
Do you know how to implement silent authentication ?
Regards,
-seiji
- markive10 years ago
Advocate II
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.