Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am using M language to create custom connectors and Typescript to create the custom visual.
I want to pass the access_token(using Oauth 2) that is fetched using the custom connector to the custom visual.
How this can be done?
Any Solutions?
Thanks in advance.
Hi @MonikaGole,
Custom visuals are fully sandboxed from the main window, so as per my previous post, the only way to get data into them is from the data model, either through fields in the data set, or via a property set by conditional formatting.
Therefore, the 'common storage' paradigm you're looking for (based on how Power BI currently works) would be the data model in the workbook. This means that the token needs to be available in the data model after data transformation has completed.
Regards,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi @MonikaGole,
The only way to do this with a custom visual would be to load the OAuth token to your data model so that you could add it to your custom visual's dataset as a column or measure in the dataset. You could also add via a property that would accept a measure via conditional formatting.
Custom visuals are not able to access anything that they aren't supplied by a report creator via these means for security reasons, i.e. they cannot look at your data model or other objects in your report and all data is pushed to them from the main window, based on user configuration and the capabilities you expose for their data view and properties.
It's not clear from your request if the token you're intending to use would be the same as the user viewing the report, and there is an expectation for them to log in to process the data via your connector. If this is not the case,
then having an OAuth token available in the data model that might not belong to that of a report viewer presents somewhat of a security risk, as this may not be for the user who is viewing the report and could potentially be observed and extracted if they are inspecting network transactions via the developer tools, so I'm not sure if this is ideal. You would probably be better adding sign-in via the visual itself so that the user's OAuth token is used for any subsequent operations by the visual. I personally haven't tried this to advise further on how to actually implement, but someone else may be able to.
Regards,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi @dm-p
Is there any common storage provided in PowerBI which can be used between visual and connector both?
As same access token and then refresh token to be used by both connector and visual.
Currently we have provided login for both connector and visual. Thats why, to avoid the redundancy in workflow we need common storage where we can store and get the token.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |