<?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: Updating OAuth data source credentials via API - bearer token expires, invalidating connection in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Updating-OAuth-data-source-credentials-via-API-bearer-token/m-p/2124371#M32304</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your response. I thought as much, though it's news to me that the team was planning to address it. If so, that's welcome news!&lt;/P&gt;&lt;P&gt;In any case, I've submitted an idea:&amp;nbsp;&lt;A title="Add support for supplying refresh token for OAuth source in Gateways - Update Datasource API" href="https://ideas.powerbi.com/ideas/idea/?ideaid=9f9b52f1-4428-ec11-b76a-281878bdb01d" target="_blank" rel="noopener"&gt;Add support for supplying refresh token for OAuth source in Gateways - Update Datasource API&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Ed&lt;/P&gt;</description>
    <pubDate>Fri, 08 Oct 2021 14:37:57 GMT</pubDate>
    <dc:creator>ed-freeman</dc:creator>
    <dc:date>2021-10-08T14:37:57Z</dc:date>
    <item>
      <title>Updating OAuth data source credentials via API - bearer token expires, invalidating connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Updating-OAuth-data-source-credentials-via-API-bearer-token/m-p/2028001#M31241</link>
      <description>&lt;P&gt;We are connecting to our data source using OAuth credentials. Sometimes, Power BI requires us to re-enter our credentials in the Service, when the token has been invalidated for some reason (e.g. change of dataset ownership).&lt;/P&gt;&lt;P&gt;We then update the OAuth credentials via the &lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource" target="_blank" rel="noopener"&gt;Gateways - Update Datasource&lt;/A&gt; API. We provide a valid Bearer Token as per the &lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource#oauth2-credentials-example" target="_blank" rel="noopener"&gt;OAuth update example&lt;/A&gt;&amp;nbsp;and everything initially works as expected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, obviously the bearer token expires after an hour (the default for most bearer tokens), and the Power BI Service asks us to re-enter our credentials. We then have to run this code every hour (or at least before any refresh) to make sure the credentials don't expire.&lt;/P&gt;&lt;P&gt;This doesn't happen if you update the credentials through the UI - refreshing of the token must be being handled by the Power BI Service behind the scenes. But there is &lt;STRONG&gt;no option to provide a "refresh token"&lt;/STRONG&gt; in the above "Update Datasource" API.&lt;/P&gt;&lt;P&gt;So how is this meant to be handled? Or is this a limitation in the API?&lt;/P&gt;&lt;P&gt;Thanks, Ed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 10:49:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Updating-OAuth-data-source-credentials-via-API-bearer-token/m-p/2028001#M31241</guid>
      <dc:creator>ed-freeman</dc:creator>
      <dc:date>2021-08-20T10:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Updating OAuth data source credentials via API - bearer token expires, invalidating connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Updating-OAuth-data-source-credentials-via-API-bearer-token/m-p/2030041#M31259</link>
      <description>&lt;P&gt;That's a limitation in the API. I seem to recall that they were planning to address that. Not sure if it is in the works - make sure to vote for the idea/post a new one.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Aug 2021 00:38:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Updating-OAuth-data-source-credentials-via-API-bearer-token/m-p/2030041#M31259</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-08-22T00:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Updating OAuth data source credentials via API - bearer token expires, invalidating connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Updating-OAuth-data-source-credentials-via-API-bearer-token/m-p/2033872#M31292</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/72788"&gt;@ed-freeman&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this thread can help you:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Power-Query/Refresh-token-api-call/td-p/937553" target="_self"&gt;https://community.powerbi.com/t5/Power-Query/Refresh-token-api-call/td-p/937553&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Liang&lt;BR /&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;</description>
      <pubDate>Tue, 24 Aug 2021 04:45:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Updating-OAuth-data-source-credentials-via-API-bearer-token/m-p/2033872#M31292</guid>
      <dc:creator>V-lianl-msft</dc:creator>
      <dc:date>2021-08-24T04:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Updating OAuth data source credentials via API - bearer token expires, invalidating connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Updating-OAuth-data-source-credentials-via-API-bearer-token/m-p/2124371#M32304</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your response. I thought as much, though it's news to me that the team was planning to address it. If so, that's welcome news!&lt;/P&gt;&lt;P&gt;In any case, I've submitted an idea:&amp;nbsp;&lt;A title="Add support for supplying refresh token for OAuth source in Gateways - Update Datasource API" href="https://ideas.powerbi.com/ideas/idea/?ideaid=9f9b52f1-4428-ec11-b76a-281878bdb01d" target="_blank" rel="noopener"&gt;Add support for supplying refresh token for OAuth source in Gateways - Update Datasource API&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Ed&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 14:37:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Updating-OAuth-data-source-credentials-via-API-bearer-token/m-p/2124371#M32304</guid>
      <dc:creator>ed-freeman</dc:creator>
      <dc:date>2021-10-08T14:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Updating OAuth data source credentials via API - bearer token expires, invalidating connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Updating-OAuth-data-source-credentials-via-API-bearer-token/m-p/2124379#M32305</link>
      <description>&lt;P&gt;Hi Liang,&lt;/P&gt;&lt;P&gt;Thanks for the response. Unfortunately the link you've shared isn't quite the same thing and the solution isn't really viable. We're authenticating to Azure Synapse using the native connector which has built-in OAuth support. Updating credentials manually supports the refresh token scenario. It's just there's a limitation when trying to do the same thing via the API.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ed&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 14:43:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Updating-OAuth-data-source-credentials-via-API-bearer-token/m-p/2124379#M32305</guid>
      <dc:creator>ed-freeman</dc:creator>
      <dc:date>2021-10-08T14:43:35Z</dc:date>
    </item>
  </channel>
</rss>

