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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jclay
Regular Visitor

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.

1 ACCEPTED SOLUTION
14 REPLIES 14
Eric_Zhang
Employee
Employee

@yuryb

Do you have any ETA for the RLS for Embedding with non-Power BI users (app owns data)? I saw you said it would come in Aug?

Hello,

 

We expect this by the end of the week of Aug 7th.

 

Best regards

 

 


@yuryb wrote:

Hello,

 

We expect this by the end of the week of Aug 7th.

 

Best regards

 

 


@yuryb

Hope everything is going on well, it is 15th Aug now and I'm not seeing any RLS feature release in Power BI blog, any update there?

Hello,

 

RLS support was enabled last week as promissed.

Please see the August update blog: https://powerbi.microsoft.com/en-us/blog/power-bi-developer-community-august-update/

 

Best regards


@yuryb wrote:

Hello,

 

RLS support was enabled last week as promissed.

Please see the August update blog: https://powerbi.microsoft.com/en-us/blog/power-bi-developer-community-august-update/

 

Best regards


@yuryb

Thanks for your confirmation. One question, is RLS only available for embedded reports while not for Dashboards? See the test in this thread.

Indeed, currently RLS is only supported for embedded reports. Support for embedded dashboards will come later, no concrete dates yet.

 

Best regards

Hi,

 

Any news on RLS for Dashboards?  We need to test it asap. 

 

Regards,

Hi i see that now GenerateTokenRequest now accepts a list of EffectiveIdentity i am trying this with a single EffectiveIdentity with only the username set but recieve BadRequest. Any ideas / docs about this new functionality ?

Hey!

 

Username, Role and DatasetId needs to be added to the EffectiveIdentity-object.

 

Here you find an example. https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedded-rls/

 

Worked for me without any problems. Let me know if you got any further problems.

 

MeQT

Thanks i'll take a look

This does work.  I've tested it out in my application and it is filtering data as expected.

 

https://community.powerbi.com/t5/Developer/PowerBi-Embedded-API-Works-with-RLS/m-p/231064#M7285

 

MeQT
Frequent Visitor

awesome! thanks for your response

MeQT
Frequent Visitor

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors