0
votes

I'm seeking more help on the following thread, Client-credentials don't work for powerBI REST API, as I can't post any comments yet. I have the exact same situation as described in that question: I can obtain an access token, but using it for datasets gives me a 403 response. My goal is to use the Power BI REST API in Python without UI.

Could anyone clarify how the mentioned authentication flow using the username and password is achieved and at which stage? Do I first obtain the access token, or do I not need any access token at all?

Or, maybe someone has solved the authentication flow without using username and password?

Any help is greatly appreciated!

1

1 Answers

1
votes

According the authentication guide on PowerBi at https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-authenticate-to-power-bi-service/, the Power BI uses authorization code grand flow of OAuth 2.0 to authenticate your users.

And you can refer to https://azure.microsoft.com/en-us/documentation/articles/active-directory-protocols-oauth-code/#oauth-20-authorization-flow for the picture which shows you the entire authorization flow for an application. You can find in which stage, the authentication flow will verify the username and password.

Regarding, your question

Do I first obtain the access token, or do I not need any access token at all?

You can obtain the access token at first time, then when you need to set the access token in headers of the format Authentication Bearer <access token> in the HTTP requests calling to the REST APIs.