Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I am having trouble with trying to generate an access token for PowerBI JavaScript API in an app-owns-data scenario.
Following the example, I got the whole process working (with a new, custom tenant as said by the instructions).
Now, I need to move it onto the real tenant that it is being implemented on. However, when I try to get a token like before, it spits out an error saying that my username or password is incorrect, when I know for sure that it is not.
Here's an example of the code I'm using to query for one:
var settings = {
"url": "https://login.microsoftonline.com/common/oauth2/token",
"method": "POST",
"headers": { "Content-Type": "application/x-www-form-urlencoded" }
}
settings['data'] = "resource=https%3A%2F%2Fanalysis.windows.net%2Fpowerbi%2Fapi&client_id=(azurenativeapiapplicationid)&grant_type=password&username=fake@fake.com.au&password=notrealpassword&scope=openid";
$.ajax(settings).done(function(result){console.log(result)});
User | Count |
---|---|
15 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
18 | |
11 | |
5 | |
4 | |
3 |