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
Followed exactly the same steps but i am getting following error
{
"error": "invalid_grant",
"error_description": "AADSTS70002: Error validating credentials. AADSTS50126: Invalid username or password\r\nTrace ID: b089ee76-8a60-4a83-b353-fa015f0b3e00\r\nCorrelation ID: d7878fb5-5ce6-4eed-9644-a92b1a6c2069\r\nTimestamp: 2018-03-22 17:56:27Z",
"error_codes": [
70002,
50126
],
"timestamp": "2018-03-22 17:56:27Z",
"trace_id": "b089ee76-8a60-4a83-b353-fa015f0b3e00",
"correlation_id": "d7878fb5-5ce6-4eed-9644-a92b1a6c2069"
}
i have my application registered as web apllication since native app didn't have option for client_secret.
Note: i am doing this for federated user.
Another observation: i have another application which is registered as native client, if i create a console app to generate token it works but same code does not work in case if its a website.
Please help, have been haning on this for almost last 3 days.
I've also encountered this with a federated user. If I create a user in AAD itself, the credentials validate successfully.