How to do Bearer Token Authentication in PowerQuery

Поділитися
Вставка
  • Опубліковано 12 січ 2025

КОМЕНТАРІ • 10

  • @JayLinkinGrylls
    @JayLinkinGrylls 11 місяців тому +1

    thank you for this guide, really helpful!

  • @pramitbhalgama2069
    @pramitbhalgama2069 5 місяців тому +1

    Hi. Thank you for such a great explanation. I have implemented the same and it works fine in desktop, but after publishing, it does not refresh successfully. It gives a data combination error in the query due to using the accessToken function. If I am using static token, then refresh is working fine, but after making it dynamic from the function, it fails. Privacy level I have already ignored. Could you guide me on this, please?

    • @lovrosbizapps
      @lovrosbizapps  5 місяців тому

      Hey, are you passing your Bearer with the URL? If that's the case, try moving the token parameter to the Web.Contents parameters with the Query option - please search for "Web.Contents PowerQuery" on google and check out Example 1 on learn.microsoft.com. Let me know if that's the case :)

  • @bpdzgn
    @bpdzgn 10 місяців тому

    Can you explain this line - "Token = TokenJson(token)"? Where does the "token" (with lowercase t) in the brackets come from? Trying to emulate this in PowerBI.

    • @kndeepak
      @kndeepak 5 місяців тому

      token is the field name in the json response and its [ ] not ( ). square bracket is a field accessor

    • @lovrosbizapps
      @lovrosbizapps  5 місяців тому

      @@kndeepak Hey! Thank you so much for doing my job :D Just wanted to add my 2 cents - @bpdzgn Check out 11:50 - I'm calling the login endpoint and getting the "token" as a response. With TokenJson[token] I'm just extracting the token string so I can use it later. Hope that helps :)

  • @youfelixx
    @youfelixx 9 місяців тому

    is it possibile to do something like this directly in PowerBI?

    • @lovrosbizapps
      @lovrosbizapps  5 місяців тому

      Hey, sorry for late response, yes, should be possible. I'm just using Excel because PowerBI's not on a Mac (silly I know :D) but yes, PowerBI should support everything that Excel supports.

  • @bellasvideo5620
    @bellasvideo5620 4 місяці тому +2

    very messy

    • @lovrosbizapps
      @lovrosbizapps  4 місяці тому

      Thanks for the feedback 👍 Can you let me know what should I've done differently? Maybe I can make another vid to clarify anything specific? :)