<?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 GenerateTokenInGroupAsync returns BadRequest if used in GenerateTokenRequest with customData in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/GenerateTokenInGroupAsync-returns-BadRequest-if-used-in/m-p/662119#M19000</link>
    <description>&lt;P&gt;I have the challenge, want to host a PowerBI report embedded where the Row filter is to be implemented via the CustomData feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use the CustomData property, I have the problem that when calling the GenerateTokenInGroupAsync function, it always throws a BadRequest error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I call the GenerateTokenInGroupAsync function without a CustomData property I get back a valid result, only the report is not filtered.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;GenerateTokenRequest generateTokenRequestParameters = new GenerateTokenRequest(
                        accessLevel: "View",
                        identity: new EffectiveIdentity(
                            username: PowerBiAuthConstants.Username,
                            datasets: new List&amp;lt;string&amp;gt; { reportConfig.DatasetId },
                            roles: new List&amp;lt;string&amp;gt; { "Username" },
                            customData: fgnr));


var tokenResponse = await client.Reports.GenerateTokenInGroupAsync(
                        groupId: reportConfig.GroupId,
                        reportKey: report.Id,
                        requestParameters: generateTokenRequestParameters);&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Exception&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Massage: &lt;STRONG&gt;Operation returned an invalid status code 'BadRequest'&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;StackTrace:&lt;/EM&gt;&amp;nbsp;&amp;nbsp; at Microsoft.PowerBI.Api.V2.Reports.&amp;lt;GenerateTokenInGroupWithHttpMessagesAsync&amp;gt;d__22.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.PowerBI.Api.V2.ReportsExtensions.&amp;lt;GenerateTokenInGroupAsync&amp;gt;d__55.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at KIND.PowerBI.WebApi.DataAccess.PowerBiAdapter.&amp;lt;CreateEmbedConfig&amp;gt;d__0.MoveNext() in D:\TFS\PH1\Dev\services\KIND.PowerBI.WebApi\KIND.PowerBI.WebApi\DataAccess\PowerBiAdapter.cs:line 100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Apr 2019 13:47:25 GMT</pubDate>
    <dc:creator>SWAT007</dc:creator>
    <dc:date>2019-04-08T13:47:25Z</dc:date>
    <item>
      <title>GenerateTokenInGroupAsync returns BadRequest if used in GenerateTokenRequest with customData</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/GenerateTokenInGroupAsync-returns-BadRequest-if-used-in/m-p/662119#M19000</link>
      <description>&lt;P&gt;I have the challenge, want to host a PowerBI report embedded where the Row filter is to be implemented via the CustomData feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use the CustomData property, I have the problem that when calling the GenerateTokenInGroupAsync function, it always throws a BadRequest error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I call the GenerateTokenInGroupAsync function without a CustomData property I get back a valid result, only the report is not filtered.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;GenerateTokenRequest generateTokenRequestParameters = new GenerateTokenRequest(
                        accessLevel: "View",
                        identity: new EffectiveIdentity(
                            username: PowerBiAuthConstants.Username,
                            datasets: new List&amp;lt;string&amp;gt; { reportConfig.DatasetId },
                            roles: new List&amp;lt;string&amp;gt; { "Username" },
                            customData: fgnr));


var tokenResponse = await client.Reports.GenerateTokenInGroupAsync(
                        groupId: reportConfig.GroupId,
                        reportKey: report.Id,
                        requestParameters: generateTokenRequestParameters);&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Exception&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Massage: &lt;STRONG&gt;Operation returned an invalid status code 'BadRequest'&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;StackTrace:&lt;/EM&gt;&amp;nbsp;&amp;nbsp; at Microsoft.PowerBI.Api.V2.Reports.&amp;lt;GenerateTokenInGroupWithHttpMessagesAsync&amp;gt;d__22.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.PowerBI.Api.V2.ReportsExtensions.&amp;lt;GenerateTokenInGroupAsync&amp;gt;d__55.MoveNext()&lt;BR /&gt;--- End of stack trace from previous location where exception was thrown ---&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at KIND.PowerBI.WebApi.DataAccess.PowerBiAdapter.&amp;lt;CreateEmbedConfig&amp;gt;d__0.MoveNext() in D:\TFS\PH1\Dev\services\KIND.PowerBI.WebApi\KIND.PowerBI.WebApi\DataAccess\PowerBiAdapter.cs:line 100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 13:47:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/GenerateTokenInGroupAsync-returns-BadRequest-if-used-in/m-p/662119#M19000</guid>
      <dc:creator>SWAT007</dc:creator>
      <dc:date>2019-04-08T13:47:25Z</dc:date>
    </item>
  </channel>
</rss>

