<?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: PowerBi RLS with embedded analytics: spaces in username parameter in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/PowerBi-RLS-with-embedded-analytics-spaces-in-username-parameter/m-p/235874#M7426</link>
    <description>&lt;P&gt;Thanks to everybody! that's helps!&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2017 08:01:04 GMT</pubDate>
    <dc:creator>agka</dc:creator>
    <dc:date>2017-08-22T08:01:04Z</dc:date>
    <item>
      <title>PowerBi RLS with embedded analytics: spaces in username parameter</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBi-RLS-with-embedded-analytics-spaces-in-username-parameter/m-p/235254#M7416</link>
      <description>&lt;P&gt;Hi, everybody!&lt;/P&gt;&lt;P&gt;I'm testing Power BI RLS with embedded analytics, and I perform steps from this article: &lt;A href="https://powerbi.microsoft.com/ru-ru/documentation/powerbi-developer-embedded-rls/#applying-user-and-role-to-an-embed-token" target="_blank"&gt;https://powerbi.microsoft.com/ru-ru/documentation/powerbi-developer-embedded-rls/#applying-user-and-role-to-an-embed-token&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However I stuck on generating embed token, as I always get error code Bad request with message "Invalid effective username provided"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var generateTokenRequestParameters = new GenerateTokenRequest(
                    accessLevel: "view",                   
                    identities: new List&amp;lt;EffectiveIdentity&amp;gt; {
                        new EffectiveIdentity(username: "Andrey Ma", roles: new List&amp;lt;string&amp;gt; { "Manager" },
                        datasets: new List&amp;lt;string&amp;gt; { "3c1a920e-8389-44a7-8375-c179bb3b0fb2" }
                        )});&lt;BR /&gt;var tokenResponse = await client.Reports.GenerateTokenInGroupAsync(groupId, "f8288d00-81fb-4ffb-bd2f-c842079039f5", generateTokenRequestParameters);&lt;/PRE&gt;&lt;P&gt;I created report with RLS from Retail Analysis Sample&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="report with rls.jpg" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/55810i89D5156EF317F4B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="report with rls.jpg" alt="report with rls.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One interesting thing to notice, when I pass value of username without spaces, token generated successfully and report with RLS works normally. So, how I should work with values with spaces?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 12:50:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBi-RLS-with-embedded-analytics-spaces-in-username-parameter/m-p/235254#M7416</guid>
      <dc:creator>agka</dc:creator>
      <dc:date>2017-08-21T12:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBi RLS with embedded analytics: spaces in username parameter</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBi-RLS-with-embedded-analytics-spaces-in-username-parameter/m-p/235791#M7423</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/39415"&gt;@agka&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Thanks for reporting that. I can reproduce the same issue when the EffectiveUsername has any space, eg "Effective Username".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{   
    "accessLevel": "View",
    "identities": [     
        {      
            "username": "&lt;FONT size="4"&gt;&lt;STRONG&gt;EffectiveUsername&lt;/STRONG&gt;&lt;/FONT&gt;",
            "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;
&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/35536"&gt;@yuryb&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Do you have any comments on this? Is this a limitation or issue?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 06:26:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBi-RLS-with-embedded-analytics-spaces-in-username-parameter/m-p/235791#M7423</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-08-22T06:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBi RLS with embedded analytics: spaces in username parameter</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBi-RLS-with-embedded-analytics-spaces-in-username-parameter/m-p/235818#M7424</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Spaces in the username are not allowed. As a workaround you can replace the spaces in the username for example with underscore ('_') and adjust the role DAX filter accordingly. You can also create a calculated column in the model that contains usernames without spaces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 07:08:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBi-RLS-with-embedded-analytics-spaces-in-username-parameter/m-p/235818#M7424</guid>
      <dc:creator>yuryb</dc:creator>
      <dc:date>2017-08-22T07:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBi RLS with embedded analytics: spaces in username parameter</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBi-RLS-with-embedded-analytics-spaces-in-username-parameter/m-p/235874#M7426</link>
      <description>&lt;P&gt;Thanks to everybody! that's helps!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 08:01:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBi-RLS-with-embedded-analytics-spaces-in-username-parameter/m-p/235874#M7426</guid>
      <dc:creator>agka</dc:creator>
      <dc:date>2017-08-22T08:01:04Z</dc:date>
    </item>
  </channel>
</rss>

