Forum Discussion
Getting access token for user owns data (UOD) using JavaScript
Hi austinhag,
1. For the purpose of demo, these parameters including embed token are predefined and are updated automatically.
2. How can we get the embed token? Please refer to https://www.youtube.com/watch?v=GPHHdDRSlis and Embed-API-Sample.
3. The pure Javascript approach of getting access token could be azure-activedirectory-library-for-js.
Best Regards,
Dale
Further, looking at the OAuth 2.0 documentation, I assume that that for Power BI UOD embedded, we should be using the "Authorization code" grant type (as opposed to "Client credentials"). However, what's interesting is that I assume the resulting access token needs to be passed back to the browser so that the subsequent calls to powerbi.embed can be made using it.
- mittalpatel1306 years agoHelper III
austinhag - Could you identify which grant type to use in this scenario? I'm using ADAL.js to get the access token using "Client Credentials" but it returns id_toekn in Browser URL. I'm not sure how to get it from browser to load the tiles on javaScript page.
