<?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: Operation returned an invalid status code 'Forbidden'  when retrieving embed GenerateTokenAsync in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/2586746#M36793</link>
    <description>&lt;P&gt;I have exact same issue also have dedicated embed capacity and still getting 403 to acquire Embed Token&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jun 2022 12:36:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-06-18T12:36:33Z</dc:date>
    <item>
      <title>Operation returned an invalid status code 'Forbidden'  when retrieving embed GenerateTokenAsync</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/2553822#M36467</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our reports in power bi embedded stopped working . It has been working and all of a sudden it give us the Forbidden status.&lt;/P&gt;&lt;P&gt;We are using service principal model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We I debug the code Power Bi Client if successful instantiated, I can even get the list of my respots in workspace how ever when it reaches to&amp;nbsp;return await PowerBiClient.EmbedToken.GenerateTokenAsync(tokenRequest) it fails.&lt;/P&gt;&lt;P&gt;We checked the Audit log on Power Bi but we could not find anything valuable on there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a Power BI Premuim&amp;nbsp; Licence and dedicated Capacity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice would be much apprecaited!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maryam&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 22:11:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/2553822#M36467</guid>
      <dc:creator>Merry</dc:creator>
      <dc:date>2022-06-01T22:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Forbidden'  when retrieving embed GenerateTokenAsync</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/2560518#M36518</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/308139"&gt;@Merry&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;how ever when it reaches to return await PowerBiClient.EmbedToken.GenerateTokenAsync(tokenRequest) it fails.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think there should be something wrong in generate embed token. As far as I know, your service prinicpal will generate access token and then generate embed token to your customers.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may refer to this offical blog to learn more details about the workflow.&lt;/P&gt;
&lt;P&gt;For refernece:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-tokens?tabs=embed-for-customers" target="_self"&gt;Authentication flows&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/generate-embed-token" target="_self"&gt;Generate an embed token&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I suggest you to have a test to generate access token and then generate embed token by bear token(access token) in Postman by Rest API.&lt;/P&gt;
&lt;P&gt;Using &lt;STRONG&gt;Postman&lt;/STRONG&gt;, we use below POST REST API with &lt;STRONG&gt;body information&lt;/STRONG&gt; to get the &lt;STRONG&gt;Bearer Token&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RicoZhou_0-1654502444654.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/727211iC06CBCA3E13C3D9F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RicoZhou_0-1654502444654.png" alt="RicoZhou_0-1654502444654.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To use this, we will need to configure the &lt;STRONG&gt;Body&lt;/STRONG&gt; as below,&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RicoZhou_1-1654502444659.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/727212i8BFC8026216B7444/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RicoZhou_1-1654502444659.png" alt="RicoZhou_1-1654502444659.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then generate embed token in Postman.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/embed-token/generate-token" target="_self"&gt;Embed Token - Generate Token&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 08:14:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/2560518#M36518</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-06T08:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Forbidden'  when retrieving embed GenerateTokenAsync</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/2561491#M36528</link>
      <description>&lt;P&gt;Thank you for the information . It turned out that embedding Power BI reports on the tenant was disabled wrongly,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 15:01:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/2561491#M36528</guid>
      <dc:creator>Merry</dc:creator>
      <dc:date>2022-06-06T15:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Forbidden'  when retrieving embed GenerateTokenAsync</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/2586746#M36793</link>
      <description>&lt;P&gt;I have exact same issue also have dedicated embed capacity and still getting 403 to acquire Embed Token&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jun 2022 12:36:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/2586746#M36793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-18T12:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Forbidden'  when retrieving embed GenerateTokenAsync</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/2595359#M36904</link>
      <description>&lt;P&gt;Thank you s o much! We found the issue. For some reason in Admin center under Tenant --&amp;gt; Developer&amp;nbsp; Setting --&amp;gt; Embed contenet in apps had been removed. Once we specified the security group the issue is resolved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maryam&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 14:53:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/2595359#M36904</guid>
      <dc:creator>Merry</dc:creator>
      <dc:date>2022-06-22T14:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Forbidden'  when retrieving embed GenerateTokenAsync</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/3550723#M45476</link>
      <description>&lt;P&gt;I was also facing the same issue. All the API permissions were correct and it was getting hard to find the problem. So I registered a new service principal in Azure and did not configure any permissions for the service principal. And embedded the new IDs in my web app, the error got resolved. It seems there were some issue in the previous service principal.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 11:18:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-when/m-p/3550723#M45476</guid>
      <dc:creator>Ruchita</dc:creator>
      <dc:date>2023-11-24T11:18:50Z</dc:date>
    </item>
  </channel>
</rss>

