Quantcast
Channel: Developer topics
Viewing all articles
Browse latest Browse all 17892

Obtaining token to embed report

$
0
0

Hello all,

 

I write for some clarifications. Following the instructions in the last two videos of the documentation section of this page, I have embedded a report into an html code that I have run and that places a report into a web page. So far so good.

 

Problem is, I have obtained the token by running the code from the app owns data on this github in debug mode. I realize now (it probably was obvious to more savvy developer, but not to me) that that was likely just a trick. In fact, I have noticed that the token after a while expires and I need to run the software again and obtain a new (different) token.

 

Am I correct in thinking that the authorization token is not static, i.e. it changes and I will not be able to simply copy paste it into my html code once and be done with it?

 

Assuming I have to obtain the token dynamically, could you give me a suggestion on where to start? I know little (read nothing) of GET, POST, PUT and so on. I'm trying to reverse engineering what I find scattered on forums and the like. For example I have been using this simple code to embed the report:

 

// Get models. models contains enums that can be used.var models =window['powerbi-client'].models;var embedConfiguration = {
	type:'report',
	id:'5dac7a4a-4452-46b3-99f6-a25915e0fe55',
	embedUrl:'https://app.powerbi.com/reportEmbed',
	tokenType:models.TokenType.Aad,
	accessToken:'e4...rf'
};var $reportContainer =$('#reportContainer');var report =powerbi.embed($reportContainer.get(0), embedConfiguration);

 

What can I use to get the accessToken? Should I expand this html code adding something before it? Should I use the code in the example "App owns data"? But in that case, where shall I put the code I have downloaded from Github? 


Viewing all articles
Browse latest Browse all 17892

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>