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
Thanks for your reply.
That is the difficulty we are having - As it doesnt appear that the acquireToken method has user name and password parameters. So whether we get their windows login, or whether the login to our application was the same as their Powerbi account, its how do we pass the username and password in the acquireToken method we are stuck on.
Do you have a link to an example where the acquireToken method has username and password elements for a "user owns data" scenario ?
There are a number of articles online about silent authentication for "Access token for non-Power BI users (app owns data)"
I havent been able to find any about silent auhtentication for "Access token for Power BI users (user owns data)"
Reference https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-get-azuread-access-token/
This article has an example.... This example is for when your users will manually log into Azure AD with their organziation login. This is used when embedding content for Power BI users that will access content they have access to within the Power BI service.
But like I explain above I want to log them in silently as whether we store the username and password or obtain it from another source we will have it. As our application is non web UI, it makes it a ordinary user exeprience opening a web page for a user to log in with credentials we will already have access to, before having to run our application. We would like to do it for them in the background using the API.
If you have any links for additional details on how we would achieve what you have said is technically possible that would be fantastic. Thanks in advance for the time taken to read and address my query
The code snippet I sent in a previous reply to you shows how to call the acquire token method with an email and password....
- shaunwilks8 years ago
Helper V
We must be missing something as your snippet uses authContext.AcquireToken
The AcquireToken() doesn’t accept the email and password parameters at least not from the following link