<?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: Get MS AAD access token in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-MS-AAD-access-token/m-p/2892818#M91023</link>
    <description>&lt;P&gt;I've the same issue , it works with another api with oauth2&amp;nbsp; for another system but not for microsoftlogin whereas it works in postman...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2022 15:56:53 GMT</pubDate>
    <dc:creator>sebMTW2022</dc:creator>
    <dc:date>2022-11-08T15:56:53Z</dc:date>
    <item>
      <title>Get MS AAD access token</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-MS-AAD-access-token/m-p/2528281#M76733</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am trying to get a Microsoft AAD access token using a Power Query:&lt;/SPAN&gt;&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;let
     url = "https://login.microsoftonline.com/&amp;lt;tenant_id&amp;gt;/oauth2/v2.0/token",
    
     body  = "{ ""client_id"": ""&amp;lt;client_id&amp;gt;"",  ""client_secret"": ""&amp;lt;client_secret&amp;gt;"", ""grant_type"": ""client_credentials"", ""scope"":""&amp;lt;scope&amp;gt;""}",
     options = [Headers = [#"Content-Type"="application/x-www-form-urlencoded"], Content = Text.ToBinary(body)],
     tokenResponse = Json.Document(Web.Contents(url,options)),
     AccessToken = tokenResponse[access_token],
     AccessTokenHeader = "Bearer " &amp;amp; AccessToken
 in
     AccessTokenHeader&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following error:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DataSource.Error: Fehler beim Abrufen von Inhalten von "&lt;A href="https://login.microsoftonline.com/****************/oauth2/v2.0/token" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/****************/oauth2/v2.0/token&lt;/A&gt;" (400) durch "Web.Contents": Bad Request&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Need help please, can't find anything on the web.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 05:40:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Get-MS-AAD-access-token/m-p/2528281#M76733</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-20T05:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get MS AAD access token</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-MS-AAD-access-token/m-p/2530917#M76833</link>
      <description>&lt;P&gt;According to Chris Webb this will only work in custom connectors.&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2022 21:15:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Get-MS-AAD-access-token/m-p/2530917#M76833</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-05-21T21:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get MS AAD access token</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Get-MS-AAD-access-token/m-p/2892818#M91023</link>
      <description>&lt;P&gt;I've the same issue , it works with another api with oauth2&amp;nbsp; for another system but not for microsoftlogin whereas it works in postman...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 15:56:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Get-MS-AAD-access-token/m-p/2892818#M91023</guid>
      <dc:creator>sebMTW2022</dc:creator>
      <dc:date>2022-11-08T15:56:53Z</dc:date>
    </item>
  </channel>
</rss>

