<?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: Bearer generated on docs.microsoft.com works while oauth2 doesn't in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Bearer-generated-on-docs-microsoft-com-works-while-oauth2-doesn/m-p/944894#M22454</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/3821"&gt;@jppp&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for reply. Could you please evaluate how to check that access or eventually how to add this access to?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;BR /&gt;PS&lt;/P&gt;</description>
    <pubDate>Mon, 24 Feb 2020 09:49:47 GMT</pubDate>
    <dc:creator>pawels</dc:creator>
    <dc:date>2020-02-24T09:49:47Z</dc:date>
    <item>
      <title>Bearer generated on docs.microsoft.com works while oauth2 doesn't</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Bearer-generated-on-docs-microsoft-com-works-while-oauth2-doesn/m-p/944733#M22447</link>
      <description>&lt;P&gt;Good day all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm struggling for a while with generating Bearer for PBI REST API. Action that I'd like to make is to trigger truncating streaming data:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/pushdatasets/datasets_deleterowsingroup" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/pushdatasets/datasets_deleterowsingroup&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to do so I need to send DELETE message covered with bearer. When I'm using bearer generated in&amp;nbsp;&lt;EM&gt;Try it&lt;/EM&gt; section I've 200 OK answer - as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've registered app on&lt;EM&gt;&amp;nbsp;dev.powerbi.com/apps&lt;/EM&gt; for client id and secret with required scope &lt;EM&gt;Dataset.ReadWrite.All&amp;nbsp;&lt;/EM&gt;in order to generate bearer:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;string resourceUri = "&lt;A href="https://analysis.windows.net/powerbi/api" target="_blank" rel="noopener"&gt;https://analysis.windows.net/powerbi/api&lt;/A&gt;";&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;string authorityUri = "&lt;A href="https://login.windows.net/common/oauth2" target="_blank" rel="noopener"&gt;https://login.windows.net/common/oauth2&lt;/A&gt;";&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;AuthenticationContext authContext = new AuthenticationContext(authorityUri);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;string token = authContext.AcquireToken(resourceUri, new ClientCredential(clientID, clientSecret)).AccessToken;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code above works and returns bearer, but once using it I've 401 UNAUTHORIZED.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question is: why bearer generated on&amp;nbsp;&lt;EM&gt;Try it&lt;/EM&gt; section (so on my credentials) works while bearer generated on app registration doesn't?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 08:27:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Bearer-generated-on-docs-microsoft-com-works-while-oauth2-doesn/m-p/944733#M22447</guid>
      <dc:creator>pawels</dc:creator>
      <dc:date>2020-02-24T08:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Bearer generated on docs.microsoft.com works while oauth2 doesn't</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Bearer-generated-on-docs-microsoft-com-works-while-oauth2-doesn/m-p/944811#M22449</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/209792"&gt;@pawels&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing that pops my mind: does your application (=clientID) has access to the workgroup/dataset?&lt;/P&gt;&lt;P&gt;The 'try it' option is using your account to impersonate you to connect to the REST API and the code sample you share is using a ClinetID/Secret scheme to authenticate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-JP&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 09:08:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Bearer-generated-on-docs-microsoft-com-works-while-oauth2-doesn/m-p/944811#M22449</guid>
      <dc:creator>jppp</dc:creator>
      <dc:date>2020-02-24T09:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Bearer generated on docs.microsoft.com works while oauth2 doesn't</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Bearer-generated-on-docs-microsoft-com-works-while-oauth2-doesn/m-p/944894#M22454</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/3821"&gt;@jppp&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for reply. Could you please evaluate how to check that access or eventually how to add this access to?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;BR /&gt;PS&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 09:49:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Bearer-generated-on-docs-microsoft-com-works-while-oauth2-doesn/m-p/944894#M22454</guid>
      <dc:creator>pawels</dc:creator>
      <dc:date>2020-02-24T09:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Bearer generated on docs.microsoft.com works while oauth2 doesn't</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Bearer-generated-on-docs-microsoft-com-works-while-oauth2-doesn/m-p/944911#M22457</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/209792"&gt;@pawels&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SP should have been added to the 'users' that have access to the workspace, see step 5 of&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embed-service-principal#get-started-with-a-service-principal" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embed-service-principal#get-started-with-a-service-principal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-JP&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Feb 2020 10:04:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Bearer-generated-on-docs-microsoft-com-works-while-oauth2-doesn/m-p/944911#M22457</guid>
      <dc:creator>jppp</dc:creator>
      <dc:date>2020-02-24T10:04:27Z</dc:date>
    </item>
  </channel>
</rss>

