<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to embed some Power BI Tiles in a Rails App? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/74710#M2512</link>
    <description>&lt;P&gt;Hi&amp;nbsp;metricsman, thank you for sharing your experience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying different things right now, hoping I will find a clear solution.&lt;/P&gt;&lt;P&gt;Eventually I'll post it here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2016 08:06:06 GMT</pubDate>
    <dc:creator>fro_oo</dc:creator>
    <dc:date>2016-10-07T08:06:06Z</dc:date>
    <item>
      <title>How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/73608#M2458</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm struggling with this since a week... I have tried so many things, read so many documentations (walkthrough), I can't find any solutions and I have lost the clarity. I really need your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I have created a simple Rails app.&lt;/LI&gt;&lt;LI&gt;I have a Power BI account and a Azure account.&lt;/LI&gt;&lt;LI&gt;I'm using an example set of data on PowerBI (Retail Analysis Sample).&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want my users to signin on my app (through devise), then access to some pages and see embedded PowerBI Tiles (or report, or dashboard maybe). Then I want them to be able to filter the results. A client-side example is&amp;nbsp;&lt;A href="https://microsoft.github.io/PowerBI-JavaScript/demo/filters.html" target="_blank"&gt;https://microsoft.github.io/PowerBI-JavaScript/demo/filters.html&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;I want to be able to do the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm lost with all the&amp;nbsp;client id, secret, ressource uri, ressource url, ...&lt;/P&gt;&lt;P&gt;What solution/walkthrough must I use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your time,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;François&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2016 10:08:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/73608#M2458</guid>
      <dc:creator>fro_oo</dc:creator>
      <dc:date>2016-09-30T10:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/73664#M2462</link>
      <description>&lt;P&gt;Carefully?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seriously though, seems like this article should get you there:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://powerbi.microsoft.com/en-us/blog/intro-pbi-js-api/" target="_blank"&gt;https://powerbi.microsoft.com/en-us/blog/intro-pbi-js-api/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe a prerequisite to this is Power BI Embedded although I may be confused on that point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://azure.microsoft.com/en-us/services/power-bi-embedded/" target="_blank"&gt;https://azure.microsoft.com/en-us/services/power-bi-embedded/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used this walkthrough when I did it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-get-started-sample/" target="_blank"&gt;https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-get-started-sample/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2016 11:47:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/73664#M2462</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2016-09-30T11:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/73706#M2465</link>
      <description>&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Carefully? Yes &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, the JS API is not what I'm&amp;nbsp;struggling with. It's the last thing to check on my todo. And I&amp;nbsp;don't want to create a&amp;nbsp;.Net project, but a Rails one. The basic process are the same, I understand that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a bunch of questions, thank you for your expertise &amp;amp; advices :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#1&lt;/P&gt;&lt;P&gt;Do I need to&amp;nbsp;register an application for Power BI with&amp;nbsp;&lt;A href="https://dev.powerbi.com/apps?type=web" target="_blank"&gt;https://dev.powerbi.com/apps?type=web&lt;/A&gt; ?&lt;/P&gt;&lt;P&gt;(I've already done that)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#2&lt;/P&gt;&lt;P&gt;Do I need to create an ActiveDirectory (and a Azure User) ? Then add an application wich authorize Power BI Service?&lt;/P&gt;&lt;P&gt;&lt;A href="https://manage.windowsazure.com/@my-tenant.onmicrosoft.com#Workspaces/ActiveDirectoryExtension/Directory/a123456-1234-1234-1234-1a2z2a1z312az/RegisteredApp/a23z12a-z212a32-z121a2z1-21a-z212a1z/registeredAppConfigure" target="_blank"&gt;https://manage.windowsazure.com/@my-tenant.onmicrosoft.com#Workspaces/ActiveDirectoryExtension/Directory/a123456-1234-1234-1234-1a2z2a1z312az/RegisteredApp/a23z12a-z212a32-z121a2z1-21a-z212a1z/registeredAppConfigure&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(I've already done that)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#3&lt;/P&gt;&lt;P&gt;Do I need to create a Workspace for Power BI Embedded here&amp;nbsp;&lt;A href="https://portal.azure.com/#create/Microsoft.PowerBI" target="_blank"&gt;https://portal.azure.com/#create/Microsoft.PowerBI&lt;/A&gt; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To me it seems there's to many ways to implement Power BI Embedded in a web app. I am lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2016 13:19:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/73706#M2465</guid>
      <dc:creator>fro_oo</dc:creator>
      <dc:date>2016-09-30T13:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/73710#M2466</link>
      <description>&lt;P&gt;My understanding of the process and how I have gotten it to work, yes, you need to do #3. The sample application walkthrough provides a .NET command-line application and instructions for registering your Power BI Embedded instance and setting up and configuring it, etc. At least, that's what I remember.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2016 13:28:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/73710#M2466</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2016-09-30T13:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/73720#M2467</link>
      <description>&lt;P&gt;Ok, so you never had to follow that walkthrough?&lt;/P&gt;&lt;P&gt;&lt;A href="https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-integrate-tile/" target="_blank"&gt;https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-integrate-tile/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nor that one?&lt;/P&gt;&lt;P&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/mt186158.aspx" target="_blank"&gt;https://msdn.microsoft.com/en-us/library/mt186158.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Oo)&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2016 13:57:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/73720#M2467</guid>
      <dc:creator>fro_oo</dc:creator>
      <dc:date>2016-09-30T13:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/74657#M2504</link>
      <description>&lt;P&gt;I can feel you pain,&amp;nbsp;I got very confused reading the documentation when trying to setup Embeding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not fully the fault of the documentation, it's more to do with the different functionality being released at different times so older documentation speaks to functionality that embed is better for now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your requirements of having a rails app that the user logs in and views reports then Embedded is the recommended way with the exception if it is internal (users trusted) then Azure can be used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Azure application method being for internal users as the token is exposed (if they go looking for it)..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The embed method needs a server iin the middle that generates short term tokens to the user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "server in the middle" part I go stuck at for week &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The JS example you referenced if you clone it and review or look at source you can see it calls a server than returns the requried data. So for your rails app you need to build/create a server that handles that task...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps - I'm not fully there yet either so don't take this as definitive!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 07:16:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/74657#M2504</guid>
      <dc:creator>metricsman</dc:creator>
      <dc:date>2016-10-04T07:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/74710#M2512</link>
      <description>&lt;P&gt;Hi&amp;nbsp;metricsman, thank you for sharing your experience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying different things right now, hoping I will find a clear solution.&lt;/P&gt;&lt;P&gt;Eventually I'll post it here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 08:06:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/74710#M2512</guid>
      <dc:creator>fro_oo</dc:creator>
      <dc:date>2016-10-07T08:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/74722#M2514</link>
      <description>&lt;P&gt;Good luck, it definitely seems to be something that is more complicated than initially though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Great to hear your solution once you get there!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 09:34:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/74722#M2514</guid>
      <dc:creator>metricsman</dc:creator>
      <dc:date>2016-10-04T09:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/75661#M2583</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To succeed I had to forgot everything I had read before... and start again with this:&lt;/P&gt;&lt;P&gt;&lt;A href="https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-iframe/" target="_blank"&gt;https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-iframe/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ON AZURE PORTAL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Create Power BI workspace collection, and get access key (Provisioning)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GET A PBIX&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;From&amp;nbsp;Power BI Desktop or a sample file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WITH A CLI&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(must use that one : &lt;A href="https://github.com/Microsoft/PowerBI-Cli" target="_blank"&gt;https://github.com/Microsoft/PowerBI-Cli&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;Create a Power BI workspace&lt;/P&gt;&lt;P&gt;Import .pbix file into the workspace&lt;/P&gt;&lt;P&gt;Get&amp;nbsp;report&amp;nbsp;id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IN MY RAILS APP&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(using &lt;A href="https://github.com/jwt/ruby-jwt" target="_blank"&gt;https://github.com/jwt/ruby-jwt&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;Embed the report into the web page&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't tell about the many bugs encountered, or the signup/login problems with Azure... it was really painful to get there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers everyone.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 11:06:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/75661#M2583</guid>
      <dc:creator>fro_oo</dc:creator>
      <dc:date>2016-10-06T11:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/75687#M2585</link>
      <description>&lt;P&gt;Congratulations ! &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Agree on the bugs, even the CLI not running on mac took me a few hours to work out&amp;nbsp;&lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I ask so you are using just the main access key not generating a short time key ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If so how to secure it or not a factor in your use case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 11:42:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/75687#M2585</guid>
      <dc:creator>metricsman</dc:creator>
      <dc:date>2016-10-06T11:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/76093#M2607</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure to understand your question, most of the things I've done so far are beyond my own comprehension &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the "KEY 1" associated with the WorkSpace collection created on Azure portal.&lt;/P&gt;&lt;P&gt;Maybe this will help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the CLI commands:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ powerbi get-workspaces -c MyWorkspaceCollection -k TheVeryLongKey1IHaveCopiedOnTheAzurePortal123456789=

$ powerbi create-workspace -c MyWorkspaceCollection -k TheVeryLongKey1IHaveCopiedOnTheAzurePortal123456789=

$ powerbi import -c MyWorkspaceCollection -w TheWorkspaceIDIHaveJustCreated54321 -k TheVeryLongKey1IHaveCopiedOnTheAzurePortal123456789= -f ~/Downloads/Retail\ Analysis\ Sample.pbix -n "Retail Analysis Sample"

$ powerbi get-reports -c MyWorkspaceCollection -w TheWorkspaceIDIHaveJustCreated54321 -k TheVeryLongKey1IHaveCopiedOnTheAzurePortal123456789=&lt;/PRE&gt;&lt;P&gt;In Rails, my controller is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;require 'jwt'

class JwtController &amp;lt; ApplicationController

  ACCESSKEY = "TheVeryLongKey1IHaveCopiedOnTheAzurePortal123456789"

  TOKEN1 = {
    "typ" =&amp;gt; "JWT",
    "alg" =&amp;gt; "HS256",
    "wid" =&amp;gt; "TheWorkspaceIDIHaveJustCreated54321",
    "rid" =&amp;gt; "TheReportIDIHaveRetreived134679",
    "wcn" =&amp;gt; "MyWorkspaceCollection",
    "iss" =&amp;gt; "PowerBISDK",
    "ver" =&amp;gt; "0.2.0",
    "aud" =&amp;gt; "https://analysis.windows.net/powerbi/api",
    "nbf" =&amp;gt; Time.now.to_i,
    "exp" =&amp;gt; Time.now.to_i + 4 * 3600
  }

  def connect
    @token = JWT.encode TOKEN1, ACCESSKEY, 'HS256'
  end

end&lt;/PRE&gt;&lt;P&gt;Finally, the view:&lt;/P&gt;&lt;PRE&gt;&amp;lt;button id="btnView"&amp;gt;View Report !&amp;lt;/button&amp;gt;
&amp;lt;div id="divView"&amp;gt;
  &amp;lt;iframe id="ifrTile" width="100%" height="400"&amp;gt;&amp;lt;/iframe&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;script&amp;gt;
  (function () {
    document.getElementById('btnView').onclick = function() {
      var iframe = document.getElementById('ifrTile');
      iframe.src='https://embedded.powerbi.com/appTokenReportEmbed?reportId=TheReportIDIHaveRetreived134679';
      iframe.onload = function() {
        var msgJson = {
          action: "loadReport",
          accessToken: "&amp;lt;%= @token %&amp;gt;",
          height: 800,
          width: 800
        };
        var msgTxt = JSON.stringify(msgJson);
        iframe.contentWindow.postMessage(msgTxt, "*");
      };
    };
  }());
&amp;lt;/script&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope, it will help you or anyone else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 08:03:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/76093#M2607</guid>
      <dc:creator>fro_oo</dc:creator>
      <dc:date>2016-10-07T08:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to embed some Power BI Tiles in a Rails App?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/76122#M2615</link>
      <description>&lt;P&gt;I think your understand is better than mine...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Haven't used Rails but I think it's if the accesskey in the controller can be seen by an end-user they then can access the workspace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That was form:&amp;nbsp;&lt;A href="https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-iframe/" target="_blank"&gt;https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-iframe/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;But, when we embed the report in our web page, this kind of security information would be handled using JavaScript (frontend). Then the authorization header value must be secured. If our access key is discovered by a malicious user or malicious code, they can call any operations using this key."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So I've gone some complicated path of having a used call an "api" that uses the accesskey to return the shorter term token - same as what your controller does I think.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 09:09:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-embed-some-Power-BI-Tiles-in-a-Rails-App/m-p/76122#M2615</guid>
      <dc:creator>metricsman</dc:creator>
      <dc:date>2016-10-07T09:09:35Z</dc:date>
    </item>
  </channel>
</rss>

