Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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!
My course: Introduction to Developing Power BI Visuals
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!
My course: Introduction to Developing Power BI Visuals
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 |