Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RGO
New 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?

0 REPLIES 0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.