Forum Discussion
RGO
3 years agoNew Member
PowerBI-Javascript (powerbi.min.js) - no access token found for element
I'm dispaying a PowerBI dashboard using the powerbi javascript minified file.
I've registered and configured the app as it should be with correct API Permissions.
Using the following to connect and get auth token:
$getTokenParameters = array (
"requestMethod" => "POST",
"requestURL" => "https://login.microsoftonline.com/" . $tenantID . "/oauth2/token",
"postOptions" => array (
"username" => "email",
"password" => "pw",
"grant_type" => "password",
"client_id" => "XYZ123", // Azure Application_ID
"client_secret" => "XYZ", // Azure Application secret
"resource" => "https://analysis.windows.net/powerbi/api",
"scope" => "openid"
)
);
I should note this HAS worked previously, but now getting a blank screen.
Console log tells me:
<strong>Uncaught Error: No access token was found for element. You must specify an access token directly on the element using attribute 'powerbi-access-token' or specify a global token at: powerbi.accessToken.</strong>
getAccessToken https://rawgit.com/Microsoft/PowerBI-JavaScript/master/dist/powerbi.min.js:5
populateConfig https://rawgit.com/Microsoft/PowerBI-JavaScript/master/dist/powerbi.min.js:5
t https://rawgit.com/Microsoft/PowerBI-JavaScript/master/dist/powerbi.min.js:5
e https://rawgit.com/Microsoft/PowerBI-JavaScript/master/dist/powerbi.min.js:5
createEmbedComponent https://rawgit.com/Microsoft/PowerBI-JavaScript/master/dist/powerbi.min.js:5
embedNew https://rawgit.com/Microsoft/PowerBI-JavaScript/master/dist/powerbi.min.js:5
embedInternal https://rawgit.com/Microsoft/PowerBI-JavaScript/master/dist/powerbi.min.js:5
embed https://rawgit.com/Microsoft/PowerBI-JavaScript/master/dist/powerbi.min.js:5
I've even tried adding a "premium per user" license to the profile in question making the connection.
At a loss here. Have search high and low for "No access token was found for element. You must specify an access token directly on the element using attribute 'powerbi-access-token' or specify a global token at: powerbi.accessToken" but no luck so far.
Can anyone assist, please?
No RepliesBe the first to reply