Showing results for 
Search instead for 
Did you mean: 
Zuv Frequent Visitor
Frequent Visitor

Is it possible to pass username and roles with powerbi-node api?

I am happily using powerbi node api for getting reports, datasets, for uploauding reports etc.

But seems like it doesn't work with RLS and powerbi-node?

I am trying to pass user and roles and get correct token, but visuals are not displayed at all, getting error like - visual can not be displayed.. Dashboards without RLS works perfect using this method.

Maybe I am doing something wrong, here is code snippet I am using:

app.get ('/jwt/:collection/:workspaceid/:report_id/:user/:role', function(req,res) {
      var param = req.params;
      var token = powerbi.PowerBIToken.createReportEmbedToken(param.collection, param.workspaceid, param.report_id, param.user, param.role);
      var jwt = token.generate('fubar');
      res.send (jwt);
Community Support Team
Community Support Team

Re: Is it possible to pass username and roles with powerbi-node api?

@Zuv, After taking a look at powerBIToken.ts(, I find that you need to specify parameter datasetId and scopes as well.
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Top Kudoed Authors
Users Online
Currently online: 54 members 936 guests
Please welcome our newest community members: