Forum Discussion

jclay's avatar
jclay
Regular Visitor
9 years ago
Solved

Pass username and role in token request for RLS to work with an embedded app-owns-data report

I am trying to embed an app-owns-data report into my web app with RLS to restrict the report data to specific users.

 

The documentation at: 

 

https://docs.microsoft.com/en-us/azure/power-bi-embedded/power-bi-embedded-rls

 

explains that 'username' and 'role' parameters can be passed into the CreateReportEmbedToken method so that the resulting embedded report contains data relevant only to the permissions of the 'username' and 'role'. 

 

The problem I have is that the sample code on github (recently updated for the new API) uses the methods AcquireTokenAsync, and GenerateTokenInGroupAsync in order to display an embedded report, rather than CreateReportEmbedToken as per the above documentation.

 

The Async methods do not appear to support the passing of a 'username' or 'role', meaning I cannot filter my embedded report to only the username and role required.

 

What am I missing here?

 

Thanks

James.

14 Replies