<?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: How to use the Power Bi Rest Api without the refreshtoken? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3680312#M49377</link>
    <description>&lt;P&gt;The code I posted will allow you to receive an auth token without any interaction, as often as needed&amp;nbsp; (I call it before each REST API call). No need for a refresh token. Efficiency be damned.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2024 13:14:38 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-02-05T13:14:38Z</dc:date>
    <item>
      <title>How to use the Power Bi Rest Api without the refreshtoken?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3678142#M49318</link>
      <description>&lt;P&gt;I have a powershell script which is using the Power Bi Rest Api. For the authentication they use some strange solution. They capture the refresh token from the browser and save it in a txt file. Than there is some algoritme which gets a token by the refresh token in the txt file. I dont like this ugly solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I use the Power Bi Rest Api without this ugly refreshtoken solution? I would like to run this script in an Azure function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would for example run this rest api:&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;https://api.powerbi.com/v1.0/myorg/groups/{groupId}/dataflows/{dataflowId}/transactions&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2024 23:33:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3678142#M49318</guid>
      <dc:creator>KEMKEM</dc:creator>
      <dc:date>2024-02-03T23:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Power Bi Rest Api without the refreshtoken?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3678189#M49320</link>
      <description>&lt;P&gt;Ask for a bog standard auth token each time before your API call.&amp;nbsp; You need to have an app registered with the required scope, client secret etc.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2024 01:51:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3678189#M49320</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-04T01:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Power Bi Rest Api without the refreshtoken?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3679614#M49338</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;&amp;nbsp;&amp;nbsp;Do you have more info? Maybe some link to a tutorial or blog? Or some code snipped?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 08:23:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3679614#M49338</guid>
      <dc:creator>KEMKEM</dc:creator>
      <dc:date>2024-02-05T08:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Power Bi Rest Api without the refreshtoken?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3680258#M49375</link>
      <description>&lt;P&gt;for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# Calls the Active Directory Authentication Library (ADAL) to authenticate against AAD
function GetAuthToken
{
    if(-not (Get-Module AzureRm.Profile)) {
        Import-Module AzureRm.Profile
    }
    $clientId = "xxx"
    $redirectUri = "urn:ietf:wg:oauth:2.0:oob"
    $resourceAppIdURI = "https://analysis.windows.net/powerbi/api"
    $authority = "https://login.microsoftonline.com/common/oauth2/authorize";
    $authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList $authority
    $authResult = $authContext.AcquireToken($resourceAppIdURI, $clientId, $redirectUri, "Auto")
    return $authResult
}

# Get the auth token from AAD
$token = GetAuthToken&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Feb 2024 12:47:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3680258#M49375</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-05T12:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Power Bi Rest Api without the refreshtoken?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3680285#M49376</link>
      <description>&lt;P&gt;I dont understand what you mean. Please share some documentation or code snipped.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 12:58:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3680285#M49376</guid>
      <dc:creator>KEMKEM</dc:creator>
      <dc:date>2024-02-05T12:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Power Bi Rest Api without the refreshtoken?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3680312#M49377</link>
      <description>&lt;P&gt;The code I posted will allow you to receive an auth token without any interaction, as often as needed&amp;nbsp; (I call it before each REST API call). No need for a refresh token. Efficiency be damned.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 13:14:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-use-the-Power-Bi-Rest-Api-without-the-refreshtoken/m-p/3680312#M49377</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-05T13:14:38Z</dc:date>
    </item>
  </channel>
</rss>

