Forum Discussion
Guide to Implementing 3-Legged OAuth in Power BI Custom Visual
- 1 year ago
Hi Vishnu_G ,
Power BI does not provide a supported way to pass the access token from a custom connector (M extension) to a custom visual.
This is by design:
-
The access token lives in Power Query's credential store and is never exposed to the model or visuals.
-
Even if you return it as part of the dataset (e.g., in a column), it is considered a sensitive field and will be encrypted or stripped when published to the Power BI Service.
The other option is using the authentication API, but it is only available for certified visuals and also is only compatible with backends that use Entra ID authentication.
Additionally, you can follow
Custom Development Discussions to get an idea about your query.-
https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/bd-p/CustomVisualsDevelopmentDiscussionAnd a smililar issue-
https://community.fabric.microsoft.com/t5/Developer/Authentication-API-with-Organizational-Custom-Visual/m-p/4634659
Hope this helps!
If you find this post helpful, please mark it as an "Accept as Solution" and give Kudo. Feel free to reach out if you need further assistance.
Thanks and Regards -
You can host the 3-legged OAuth flow in an external web service to handle Autodesk authentication. The resulting token can then be passed to Power BI using a custom connector. For implementation details, see Power BI Custom Connectors.
While tokens are sandboxed, you can fetch authenticated data via the connector and pass it to the custom visual using datasets or parameters. The visual can then use this data to display relevant information. Refer to the below github link Power BI Visuals Development for guidance.
- Vishnu_G1 year agoFrequent Visitor
Just to clarify my use case:
I'm successfully getting data from an authenticated custom connector that uses Autodesk's 3-legged OAuth.However, I also need to use the access token inside a custom visual, along with the data. Is there any way to pass the token to the visual from the connector, or any supported workaround that would allow the visual to reuse the token?
Appreciate any guidance on how this might be achieved within Power BI's constraints.