Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello all!
I am hoping that someone has a solution or guidance. The documentation for using OAuth in custom connectors for Power BI leaves a lot to be desired.....
Here is the experiene I am trying to create when setting up the connector in Power BI Desktop. I am new to M Language, so I'm having trouble understanding the standard OAuth flow.
Where I am having an issue is that my data source doesn't follow the prescribed path for OAuth in Power BI connectors - the API Token is generated with a POST to {client_id}:{client_secret}@{baseurl}/rest/oath/token and a body with grant_type = client_credentials. This API call returns a JSON with access_token that can then be stored as a variable applied in the header.
Here is a screenshot from Postman of a successful token request:
Basically, it does not seem like I need the StartLogin section, or I'm not sure what to put in that section since there is no authorization URL, just a token request URL.
Any guidance on this would be GREATLY appreciated.
Solved! Go to Solution.
Hi @pgarman ,
Based on my understanding and research, your approach of generating a Bearer Token via OAuth to access certain APIs seems to support an “anonymous” connection mode. However, it’s important to note that this Bearer Token is dynamic and typically has a validity period of one hour. If you wish to implement a method for dynamically generating the Bearer Token, you’ll need to use M query to obtain the latest Bearer Token in real-time during each data refresh. You can refer to the following links to determine if they provide any helpful insights:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @pgarman ,
Based on my understanding and research, your approach of generating a Bearer Token via OAuth to access certain APIs seems to support an “anonymous” connection mode. However, it’s important to note that this Bearer Token is dynamic and typically has a validity period of one hour. If you wish to implement a method for dynamically generating the Bearer Token, you’ll need to use M query to obtain the latest Bearer Token in real-time during each data refresh. You can refer to the following links to determine if they provide any helpful insights:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I have set up a connector using Anonymous rather than OAuth, but it is not reliable - about 25% of the initial connections or data refreshes return an error from Power BI Desktop that the credentials could not be authenticated.
I suspect this might be due to the connector requesting a new token with each 'page' of records, but it's hard to see what is actually happening since Power BI does not give the actual error message from the data source being queried.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 |