<?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: Generate proper token in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Generate-proper-token/m-p/4023036#M53877</link>
    <description>&lt;P&gt;Thank you,&amp;nbsp;@Ibend for your input.&amp;nbsp; Much appreciated.&lt;/P&gt;&lt;P&gt;We went with "embed for customers" instead of "embed for organization".&amp;nbsp; It's my understanding that "embed for organziation" uses Entra ID and each app user needs a Power BI license.&amp;nbsp; Our app owns the data and so we went with the service principal to authenticate and therefore "embed for customers".&amp;nbsp; Is that your understanding, or am I missing something?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2024 14:00:24 GMT</pubDate>
    <dc:creator>VikiK</dc:creator>
    <dc:date>2024-07-03T14:00:24Z</dc:date>
    <item>
      <title>Generate proper token</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Generate-proper-token/m-p/4020789#M53848</link>
      <description>&lt;P&gt;Hello - Looking for some direction and detailed instructions, please.&lt;BR /&gt;I am trying to generate a token for embedded reports in a React front end.&lt;/P&gt;&lt;P&gt;I have followed this article:&amp;nbsp;&lt;A href="https://medium.com/globant/how-to-embed-a-power-bi-report-in-react-f27e975e0a" target="_blank" rel="noopener nofollow noreferrer"&gt;https://medium.com/globant/how-to-embed-a-power-bi-report-in-react-f27e975e0a&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I found this code:&amp;nbsp;&lt;A href="https://github.com/KotanaSai21/powerbi-embedded-React-demo/blob/main/GenerateToken.csx" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/KotanaSai21/powerbi-embedded-React-demo/blob/main/GenerateToken.csx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I wrote a Java API for React to call in case it needed to be client-&amp;gt;server-&amp;gt;client thing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 1 (in the article) will work; I get an access_token.&lt;/P&gt;&lt;P&gt;However, using that access_token as a bearer token in Steps 2 and Steps3 result in a 401.&lt;/P&gt;&lt;P&gt;(Using Postman)&lt;/P&gt;&lt;P&gt;Also, when using&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/embed-token/generate-token#code-try-0" target="_blank" rel="noopener nofollow noreferrer"&gt;Embed Token - Generate Token - REST API (Power BI Power BI REST APIs) | Microsoft Learn,&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(as also described in Step 3 of the article), it is successful from here when I "try this", but again a 401 from Postman. I notice that the Bearer Token used here in the MS Learn link is much longer than the access_token I receive in Step 1 from Postman.&amp;nbsp; Where/How does it get the Bearer Token used in the MS Learn link?&lt;BR /&gt;&lt;BR /&gt;Looking for some direction on doing this programmatically, please - either via React or Java microservice - I just need it to work.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VikiK_0-1719931683918.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1125485iE7BBC5D649F73829/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VikiK_0-1719931683918.png" alt="VikiK_0-1719931683918.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am using a service principal for tenant id, along with client_id,&amp;nbsp; and client_secret, ect.&lt;BR /&gt;Thanks in advance-&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 14:48:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Generate-proper-token/m-p/4020789#M53848</guid>
      <dc:creator>VikiK</dc:creator>
      <dc:date>2024-07-02T14:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Generate proper token</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Generate-proper-token/m-p/4021500#M53860</link>
      <description>&lt;P&gt;most likely you didn't ask for the right scope when creating the app in Entra ID.&amp;nbsp; Check your token's scope with jwt.io&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 01:44:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Generate-proper-token/m-p/4021500#M53860</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-07-03T01:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Generate proper token</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Generate-proper-token/m-p/4023036#M53877</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;@Ibend for your input.&amp;nbsp; Much appreciated.&lt;/P&gt;&lt;P&gt;We went with "embed for customers" instead of "embed for organization".&amp;nbsp; It's my understanding that "embed for organziation" uses Entra ID and each app user needs a Power BI license.&amp;nbsp; Our app owns the data and so we went with the service principal to authenticate and therefore "embed for customers".&amp;nbsp; Is that your understanding, or am I missing something?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 14:00:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Generate-proper-token/m-p/4023036#M53877</guid>
      <dc:creator>VikiK</dc:creator>
      <dc:date>2024-07-03T14:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Generate proper token</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Generate-proper-token/m-p/4023165#M53878</link>
      <description>&lt;P&gt;Not exactly.&amp;nbsp; &amp;nbsp;It is mostly a question if you are authenticating based on the (internal) user&amp;nbsp; SSPI or on the (external) user id (like an email address).&amp;nbsp; The license discussion is separate and depends on the SKU and the sharing method.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 15:09:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Generate-proper-token/m-p/4023165#M53878</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-07-03T15:09:48Z</dc:date>
    </item>
  </channel>
</rss>

