<?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: Using the Power BI Authentication API returns accessToken null in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4371043#M12055</link>
    <description>&lt;P&gt;Use the custom connector. It implements AAD auth.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2025 04:16:30 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2025-01-20T04:16:30Z</dc:date>
    <item>
      <title>Using the Power BI Authentication API returns accessToken null</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/3885538#M9584</link>
      <description>&lt;P&gt;I'm developing a custom visual for Power BI, and I'm trying to use the Authentication API (&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/visuals/authentication-api" target="_blank"&gt;https://learn.microsoft.com/en-us/power-bi/developer/visuals/authentication-api&lt;/A&gt;). I wrote this function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  const authenticate = () =&amp;gt; {
    props.host.acquireAADTokenService.acquireAADTokenstatus().then((acquireTokenStatus) =&amp;gt; {
      console.log('allowed?', acquireTokenStatus)
      if (acquireTokenStatus === powerbi.PrivilegeStatus.Allowed) {
        props.host.acquireAADTokenService
          .acquireAADToken()
          .then((acquireAADTokenResult: AcquireAADTokenResult) =&amp;gt; {
            console.log('access token', acquireAADTokenResult)
            if (acquireAADTokenResult.accessToken) {
              getDatasetInfo(acquireAADTokenResult.accessToken, props.datasetId).then((createdDataset) =&amp;gt;
                setDataset(createdDataset),
              )
            }
          })
      }
    })
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It logs `allowed? 0`, meaning the privilege is allowed in the project, and then the accessToken is always null. I enabled the option of obtaining Entra ID tokens (&lt;A href="https://learn.microsoft.com/en-us/fabric/admin/organizational-visuals#obtain-microsoft-entra-access-token" target="_blank"&gt;https://learn.microsoft.com/en-us/fabric/admin/organizational-visuals#obtain-microsoft-entra-access-token&lt;/A&gt;). I also added the privileges to the project, with the url I configured in my Azure application&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;{
  "privileges": [
    {
      "name": "WebAccess",
      "essential": true,
      "parameters": ["*"]
    },
    {
      "name": "ExportContent",
      "essential": true
    },
    {
      "name": "AADAuthentication",
      "parameters": ["https://mywebsite.com"]
    }
  ],&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also added permissions in the Azure application and&amp;nbsp;I tried adding localhost as a URI redirect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From what I understood this should be working. What's missing?&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 09:28:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/3885538#M9584</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-02T09:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Power BI Authentication API returns accessToken null</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4368799#M12044</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;I am facing same issue while using&amp;nbsp;&lt;SPAN&gt;Power BI Authentication API, did you manage to find a solution?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 08:35:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4368799#M12044</guid>
      <dc:creator>pramodcog</dc:creator>
      <dc:date>2025-01-17T08:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Power BI Authentication API returns accessToken null</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4370260#M12052</link>
      <description>&lt;P&gt;No, and I actually received a response from Microsoft saying they actually don't enable the same credentials for Power BI and for this API, so as of 6 months ago it was simply not possible.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2025 15:27:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4370260#M12052</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-18T15:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Power BI Authentication API returns accessToken null</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4370346#M12053</link>
      <description>&lt;P&gt;Oh ok, how did you manage to get access token or is their any other alternative?&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2025 21:39:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4370346#M12053</guid>
      <dc:creator>pramodcog</dc:creator>
      <dc:date>2025-01-18T21:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Power BI Authentication API returns accessToken null</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4371043#M12055</link>
      <description>&lt;P&gt;Use the custom connector. It implements AAD auth.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 04:16:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4371043#M12055</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-01-20T04:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Power BI Authentication API returns accessToken null</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4373401#M12064</link>
      <description>&lt;P&gt;I am very new to PowerBI and custom visual, would be helpful if you can share an example how custom connectors can be linked to custom visual for authentication, if its not an overhead!!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 10:10:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4373401#M12064</guid>
      <dc:creator>pramodcog</dc:creator>
      <dc:date>2025-01-21T10:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Power BI Authentication API returns accessToken null</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4373740#M12066</link>
      <description>&lt;P&gt;Sorry, my reply was for Power Query, not for custom visuals.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 13:39:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4373740#M12066</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-01-21T13:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Power BI Authentication API returns accessToken null</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4373862#M12068</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Oh ok, how did you manage to get access token or is their any other alternative?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 14:43:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4373862#M12068</guid>
      <dc:creator>pramodcog</dc:creator>
      <dc:date>2025-01-21T14:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Power BI Authentication API returns accessToken null</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4374346#M12071</link>
      <description>&lt;P&gt;You register an app in Azure that asks for the (non-delegated) permissions for whatever API calls you need to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 20:15:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4374346#M12071</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-01-21T20:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Power BI Authentication API returns accessToken null</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4382926#M12104</link>
      <description>&lt;P&gt;I have managed to get the acces token, there were lot of setting to be done.&lt;BR /&gt;Now I am trying to acheive a token exchange in backend for &lt;A href="https://login.microsoft******" target="_blank"&gt;https://login.microsoft******&lt;/A&gt;,&amp;nbsp;&amp;nbsp;but I am blocked by the CORS error even though I have added the URL into privilages parameter in capabilities.json file.&lt;BR /&gt;I have read &lt;A href="https://www.html-content.com/reference/limitations#custom-visuals-high-level" target="_blank" rel="noopener"&gt;CORS limitation&lt;/A&gt;&amp;nbsp;, is there a alternate workaround for token exchange?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 17:15:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4382926#M12104</guid>
      <dc:creator>pramodcog</dc:creator>
      <dc:date>2025-01-27T17:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Power BI Authentication API returns accessToken null</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4830878#M12818</link>
      <description>&lt;P&gt;Hello, is there a possibility that you remember and can help me with the topic issue (accessToken: null). You said that there were a lot of settings to be done.&lt;BR /&gt;But which exactly? I have followed Microsoft documentation multiple times but without results.&lt;BR /&gt;I have tried to set permissions (User: ReadAll) as both delegated and application as mentioned in this thread.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Sep 2025 16:49:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Using-the-Power-BI-Authentication-API-returns-accessToken-null/m-p/4830878#M12818</guid>
      <dc:creator>ViktorDidyk</dc:creator>
      <dc:date>2025-09-19T16:49:28Z</dc:date>
    </item>
  </channel>
</rss>

