Forum Discussion
Pass data from loaded custom connector to custom visual in PowerBI Desktop App
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
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.