<?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: Populating TokenRequest EffectiveIdentity object what AAD Service Principal name should be used? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Populating-TokenRequest-EffectiveIdentity-object-what-AAD/m-p/2256608#M33625</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/235907"&gt;@WayneT&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;As mentioned in &lt;A href="https://docs.microsoft.com/en-us/power-bi/admin/service-admin-rls#considerations-and-limitations" target="_self"&gt;&lt;STRONG&gt;this official documentation&lt;/STRONG&gt;&lt;/A&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Service principals cannot be added to an RLS role. Accordingly, RLS won’t be applied for apps using a service principal as the final effective identity.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yingyinr_0-1640593779652.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/648640iAF5EB23C95BB9342/image-size/large?v=v2&amp;amp;px=999" role="button" title="yingyinr_0-1640593779652.png" alt="yingyinr_0-1640593779652.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embedded-row-level-security#applying-user-and-role-to-an-embed-token" target="_self"&gt;&lt;STRONG&gt;Applying user and role to an embed token&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Mon, 27 Dec 2021 08:31:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-12-27T08:31:31Z</dc:date>
    <item>
      <title>Populating TokenRequest EffectiveIdentity object what AAD Service Principal name should be used?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Populating-TokenRequest-EffectiveIdentity-object-what-AAD/m-p/2254415#M33607</link>
      <description>&lt;P&gt;We display reports to users of our SaaS application by embedding them. The config to get the embed url uses a Service Principal.&lt;BR /&gt;For a time we have been using a JavaScript filter to filter report data based on a user's group. This is problematic because a user could potentially hack it and see other groups data.&lt;BR /&gt;&lt;BR /&gt;We have attempted to implement Row Level Security (RLS) while getting the embed token using the code below.&lt;BR /&gt;&lt;BR /&gt;Each user does not have a user account in AAD, so we want to use the Service Principal of the Enterprise Application registered in AAD that we use to get the access token for talking to the api.&lt;BR /&gt;&lt;BR /&gt;Using the C# SDK no matter what username I put in to the EffectiveIdentity it returns a status code of 'Unauthorized'.&lt;BR /&gt;Have tried:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Name&lt;/LI&gt;&lt;LI&gt;Application Id&lt;/LI&gt;&lt;LI&gt;Object Id&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Has anyone else had experience with this and can give me an idea what value should be used for the username property?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;            var tokenRequest = new GenerateTokenRequestV2(

                reports: new List&amp;lt;GenerateTokenRequestV2Report&amp;gt;() { new GenerateTokenRequestV2Report(reportId) },

                datasets: datasetIds.Select(datasetId =&amp;gt; new GenerateTokenRequestV2Dataset(datasetId.ToString())).ToList(),

                targetWorkspaces: targetWorkspaceId != Guid.Empty ? new List&amp;lt;GenerateTokenRequestV2TargetWorkspace&amp;gt;() { new GenerateTokenRequestV2TargetWorkspace(targetWorkspaceId) } : null
            );

            tokenRequest.Identities = new List&amp;lt;EffectiveIdentity&amp;gt; {
            new EffectiveIdentity("[Service Principal Object Id]" 
            //                    //,reports: new List&amp;lt;string&amp;gt;() { reportId.ToString() }
                                ,datasets: datasetIds.Select(datasetId =&amp;gt; datasetId.ToString()).ToList()
            //                    ,roles: new[] { "CommunityAdmin" }
            //                    //, customData:"0ea41e5e-13aa-4a15-8fdc-a7b152dfb089"
            )                 
            };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 23:07:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Populating-TokenRequest-EffectiveIdentity-object-what-AAD/m-p/2254415#M33607</guid>
      <dc:creator>WayneT</dc:creator>
      <dc:date>2021-12-23T23:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Populating TokenRequest EffectiveIdentity object what AAD Service Principal name should be used?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Populating-TokenRequest-EffectiveIdentity-object-what-AAD/m-p/2256608#M33625</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/235907"&gt;@WayneT&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;As mentioned in &lt;A href="https://docs.microsoft.com/en-us/power-bi/admin/service-admin-rls#considerations-and-limitations" target="_self"&gt;&lt;STRONG&gt;this official documentation&lt;/STRONG&gt;&lt;/A&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Service principals cannot be added to an RLS role. Accordingly, RLS won’t be applied for apps using a service principal as the final effective identity.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yingyinr_0-1640593779652.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/648640iAF5EB23C95BB9342/image-size/large?v=v2&amp;amp;px=999" role="button" title="yingyinr_0-1640593779652.png" alt="yingyinr_0-1640593779652.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embedded-row-level-security#applying-user-and-role-to-an-embed-token" target="_self"&gt;&lt;STRONG&gt;Applying user and role to an embed token&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 27 Dec 2021 08:31:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Populating-TokenRequest-EffectiveIdentity-object-what-AAD/m-p/2256608#M33625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-27T08:31:31Z</dc:date>
    </item>
  </channel>
</rss>

