Forum Discussion

sjorg's avatar
sjorg
Frequent Visitor
8 years ago
Solved

Authentication and Read/Write using Javascript API

Trying to do something really really simple - but it seems like you have to scale a 100ft wall every step of the way.   Background:   1) I'd like to use this https://github.com/Microsoft/PowerBI-...
  • Eric_Zhang's avatar
    8 years ago

    sjorg

     

    As far as I know, the Power BI JavaScript wrapper is only for embedding purpose. It is not for pushing data at all. As to the "App Owns Data" scenario, it usually requires a Native app, so no client_secret is involved. For your interest, you can referece Creating the application Client ID and Client Secret from Microsoft Azure new portal

     

    To get an accesstoken for pushing data, it is the ADAL lib, the github lib you've already known. You can reference sample in Anonymous last reply in this thread

     

    By the way, why all in Javascript? For "App Owns Data", it actually uses a master account. While using ADAL, you'll have to do the authentication through a pop up log-on window. I'm not an expert on ADAL however I doubt ADAL would support to do the authentication by passing username&&password instead of the pop-up. Even it supports, I don't think it is a good idea to hard coded the username&&password in your Javascript or Web page, it is definitely risky.