<?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: authorisation with user principal to REST API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/authorisation-with-user-principal-to-REST-API/m-p/3237770#M42688</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/560686"&gt;@lurbanek&lt;/a&gt;&amp;nbsp;you are app is probably missing the right scopes. As you can see in the documentation (for instance&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/get-dataset" target="_blank"&gt;Datasets - Get Dataset - REST API (Power BI Power BI REST APIs) | Microsoft Learn)&lt;/A&gt; each request has a required scope. In the example above the required scopes are&amp;nbsp;&lt;SPAN&gt;Dataset.ReadWrite.All or Dataset.Read.All.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You need to set up these scopes for the application you registered in AD (you are already using the client_id and client_secret of this application when requesting a token. If you do not know how to do it, you can follow Step 2 - Register Application,&amp;nbsp; of this guide:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/register-app?tabs=customers" target="_blank"&gt;Get started with Power BI Embedded - Power BI | Microsoft Learn.&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let me know if this solve your problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2023 12:05:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-05-16T12:05:35Z</dc:date>
    <item>
      <title>authorisation with user principal to REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/authorisation-with-user-principal-to-REST-API/m-p/3235660#M42663</link>
      <description>&lt;P&gt;I have issues with using the REST API with User Principal. Let me share the issue with you.&lt;/P&gt;&lt;P&gt;1. I'm getting the access token from here:&lt;BR /&gt;&lt;SPAN&gt;&lt;A target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/&amp;lt;instance_id&amp;gt;/oauth2/token,&lt;/A&gt;&amp;nbsp;providing client_id, resource ("&lt;A href="https://analysis.windows.net/powerbi/api" target="_blank" rel="noopener"&gt;https://analysis.windows.net/powerbi/api"&lt;/A&gt;), client_secret and grant_type ("user_credentials").&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. With this token I can access the "Admin" part of the REST API:&lt;BR /&gt;&lt;A target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/admin/&amp;lt;anything&amp;gt;&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. But I can't access other parts of the REST API, receiving "403 Forbidden" (ie. here:&amp;nbsp;&lt;A href="https://api.powerbi.com/reports/api/v2.0/myorg/me" target="_blank" rel="noopener"&gt;https://api.powerbi.com/reports/api/v2.0/myorg/me&lt;/A&gt;)&lt;BR /&gt;4. In particular I'm interested in using the part of API described here:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/datasets" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/rest/api/power-bi/datasets&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What am I missing here?&amp;nbsp;&lt;BR /&gt;Do I need to create other type of access token?&lt;BR /&gt;Do I miss some configuration?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thank you in advance for any help&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 12:33:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/authorisation-with-user-principal-to-REST-API/m-p/3235660#M42663</guid>
      <dc:creator>lurbanek</dc:creator>
      <dc:date>2023-05-15T12:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: authorisation with user principal to REST API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/authorisation-with-user-principal-to-REST-API/m-p/3237770#M42688</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/560686"&gt;@lurbanek&lt;/a&gt;&amp;nbsp;you are app is probably missing the right scopes. As you can see in the documentation (for instance&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/get-dataset" target="_blank"&gt;Datasets - Get Dataset - REST API (Power BI Power BI REST APIs) | Microsoft Learn)&lt;/A&gt; each request has a required scope. In the example above the required scopes are&amp;nbsp;&lt;SPAN&gt;Dataset.ReadWrite.All or Dataset.Read.All.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You need to set up these scopes for the application you registered in AD (you are already using the client_id and client_secret of this application when requesting a token. If you do not know how to do it, you can follow Step 2 - Register Application,&amp;nbsp; of this guide:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/register-app?tabs=customers" target="_blank"&gt;Get started with Power BI Embedded - Power BI | Microsoft Learn.&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let me know if this solve your problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 12:05:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/authorisation-with-user-principal-to-REST-API/m-p/3237770#M42688</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-16T12:05:35Z</dc:date>
    </item>
  </channel>
</rss>

