Forum Discussion
Authentication and Read/Write using Javascript API
- 8 years ago
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.
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.