cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Zuv
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);
})
1 REPLY 1
Highlighted
Community Support
Community Support

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

@Zuv, After taking a look at powerBIToken.ts(https://github.com/Microsoft/PowerBI-Node/blob/f9e00fdea65b55d2ccc5c7ffcc8b36bbaab0c3ea/lib/core/pow...), 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

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.