<?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 Power Bi Embedded RLS with REST API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/230192#M7253</link>
    <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is kind of urgent so any quick help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have built out a Proof of Concept web-app that will embed Power BI Dashboards. When a user signs in, we want them to only be able to view the data that belongs to their organization. We are currently doing all of the token and authentication through the Power BI Rest api. We are able to embed our dashboards just fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In desktop, I create a user role that determines if Email=USERNAME(). In desktop this works great, when you are not the correct user, you see blank visualizations and when you are, you see the appropriate data. I publish this into my workspace. I test the RLS there, works just fine. I embed it into our webapp&amp;nbsp;and unfortunately anyone can see all of the data. (RLS is NOT working once embedded).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, we are handling authentication thorugh REST API. I believe this is the shortfall. I think we need to use the javascript library to generate the report token while passing in the username/role. Is this a correct assumption?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what we are doing with the REST API. But again, when we go to the dashboard, no RLS seems to be working. Any advice?&lt;/P&gt;&lt;PRE&gt;def get_power_bi_embed_token(email, adal_session, dashboard_id):
    GENERATE_EMBED_TOKEN_URL= "https://api.powerbi.com/v1.0/myorg/groups/%s/dashboards/%s/GenerateToken" % (settings.POWER_BI_GROUP_ID, dashboard_id)

    response = adal_session.post(GENERATE_EMBED_TOKEN_URL, json={
        "accessLevel":"View",
        "username":email,
        "roles":"User",
    })
    return response.json()['token']&lt;/PRE&gt;</description>
    <pubDate>Fri, 11 Aug 2017 18:57:45 GMT</pubDate>
    <dc:creator>dcruise</dc:creator>
    <dc:date>2017-08-11T18:57:45Z</dc:date>
    <item>
      <title>Power Bi Embedded RLS with REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/230192#M7253</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is kind of urgent so any quick help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have built out a Proof of Concept web-app that will embed Power BI Dashboards. When a user signs in, we want them to only be able to view the data that belongs to their organization. We are currently doing all of the token and authentication through the Power BI Rest api. We are able to embed our dashboards just fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In desktop, I create a user role that determines if Email=USERNAME(). In desktop this works great, when you are not the correct user, you see blank visualizations and when you are, you see the appropriate data. I publish this into my workspace. I test the RLS there, works just fine. I embed it into our webapp&amp;nbsp;and unfortunately anyone can see all of the data. (RLS is NOT working once embedded).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, we are handling authentication thorugh REST API. I believe this is the shortfall. I think we need to use the javascript library to generate the report token while passing in the username/role. Is this a correct assumption?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what we are doing with the REST API. But again, when we go to the dashboard, no RLS seems to be working. Any advice?&lt;/P&gt;&lt;PRE&gt;def get_power_bi_embed_token(email, adal_session, dashboard_id):
    GENERATE_EMBED_TOKEN_URL= "https://api.powerbi.com/v1.0/myorg/groups/%s/dashboards/%s/GenerateToken" % (settings.POWER_BI_GROUP_ID, dashboard_id)

    response = adal_session.post(GENERATE_EMBED_TOKEN_URL, json={
        "accessLevel":"View",
        "username":email,
        "roles":"User",
    })
    return response.json()['token']&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Aug 2017 18:57:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/230192#M7253</guid>
      <dc:creator>dcruise</dc:creator>
      <dc:date>2017-08-11T18:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi Embedded RLS with REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/231540#M7300</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/38897"&gt;@dcruise&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on my test, &lt;STRONG&gt;the RLS is avalaible for the embedded&lt;/STRONG&gt; &lt;STRONG&gt;reports and it is not available for embedded dashboards(&lt;A href="https://community.powerbi.com/t5/Developer/Pass-username-and-role-in-token-request-for-RLS-to-work-with-an/m-p/232313#M7327" target="_self"&gt;confirmation from product team&lt;/A&gt;). &lt;/STRONG&gt;See&amp;nbsp;&lt;A href="https://msdn.microsoft.com/en-us/library/mt784614.aspx" target="_self"&gt;GenerateToken&lt;/A&gt;. While trying to call the embed token API for a dashboard with the POST body JSON as below, it response with error message "Creating embed token with effective identity for reasources of type Dashboard is not supported". The embeded view token generated in your case can view all data. So to apply RLS, you may have to embed a report at this moment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{   
    "accessLevel": "View",
    "&lt;STRONG&gt;identities&lt;/STRONG&gt;": [     
        {      
            "username": "EffectiveUsername",
            "roles": [ "Role1", "Role2" ],
            "datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ]
        }   
    ] 
} &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 10:21:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/231540#M7300</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-08-16T10:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi Embedded RLS with REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/236563#M7440</link>
      <description>&lt;P&gt;Thank you, Eric!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ironically enough, they released the documentation for this functionality literally the afternoon I posed the question! Its working great! Hoping the functionality trickles down to dashboards soon!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dylan&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 00:03:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/236563#M7440</guid>
      <dc:creator>dcruise</dc:creator>
      <dc:date>2017-08-23T00:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi Embedded RLS with REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/256775#M7924</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&amp;nbsp;can you please check with the product team, if I can pass in EffectiveIdentities to reports that use SSAS Live Connections and have roles there?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 19:10:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/256775#M7924</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-21T19:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi Embedded RLS with REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/256897#M7929</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;See&amp;nbsp;&lt;A href="https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedded-rls/#working-with-analysis-services-live-connections" target="_self"&gt;Working with Analysis Services live connections&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 01:18:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/256897#M7929</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-09-22T01:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi Embedded RLS with REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/257676#M7951</link>
      <description>&lt;P&gt;I&amp;nbsp;looked at it last week but I am not able to make it work on my application.&lt;/P&gt;&lt;P&gt;I have done everything according to this&amp;nbsp;&lt;A href="https://www.kasperonbi.com/using-customdata-and-ssas-with-power-bi-embedded/" target="_blank"&gt;link&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 21:18:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-Embedded-RLS-with-REST-API/m-p/257676#M7951</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T21:18:58Z</dc:date>
    </item>
  </channel>
</rss>

