Power bi Refresh Locally Rest API

Hi @laupie

First, let me mention that internally we don't actually use OAuth when interacting with Microsoft services. Instead, we use MSAL, which works a little bit differently.

Secondly, based on the link you shared, it seems like you are looking to implement the 'client credential' grant flow. This is a non-interactive OAuth flow where you exchange the client_id and secret for an authorization token. Am I correct in understanding this?

Our Web Location connector's OAuth section actually implements a different flow called the 'Authorization Code Flow', which is interactive. If the 'client credential' flow is available in your environment, you should use it, as it is simpler and doesn't require Redirect URI at all.

With this flow, you exchange IDs for a token in a single POST request to the https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token endpoint, where {tenant} should be replaced with your tenant.

Here is the detailed explanation how to authorize using client credentials flow:

You just need to tweak connector from example a little, to make sure the POST request points exactly to https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token, something like this: