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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jarek_blaszczyk
Regular Visitor

RLS doesn't work with identities from embed token (don't filter the report data)

Hi,

I use Power BI Embedded for display the report in the web application.
I receive correct embed token passing in the request body identities, like (values are just examples)
{
"accessLevel": "view",
"identities": [{
"username": "my_user@my_company",
"roles": ["my_role"],
"datasets": ["aaaaaaaa-0000-cccc-eeee-77777777777"]
}]
}
The problem is that RLS filtering is not working. The report is diplayed, but contains all data connected to the master account, no to "my_user@my_company" and "my_role".

The client on Power BI desktop uses the same username and role and the data is filtered. Which is the problem?
May I decode in some way the token or analize / verify it?

1 ACCEPTED SOLUTION

Solved!
The issue was tha bad key in post json: "identitites" instead of "identities".
That bug was difficult to be discovered as the request gave back the correct response with the report token. But in the request body was taken only accessLevel and identities part has been ignored.

View solution in original post

9 REPLIES 9
TriPax
Frequent Visitor

did you add this role also on the PBI report side?
you need to create some custom role called for example my_role with parameters

[column from your table with email] = username ()

yes, we did it

I'm using it at my app so it's look like that on the raport side
2018-06-14_12-16-08.png

Then in the code I'm using 

accessLevel: "view", identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: "exampleuser@company.com, roles: new List<string> { DynamicUser }, datasets: new List<string> { somedatasetid }) }

 

But I'm using .net app so it should be sth like this if we use hardcoded values

"accessLevel": "View", "identities": [ { "username": "exampleuser@company.com", "roles": [ "DynamicUser" ], "datasets": [ "somedatasetid" ] } ]

thx, I do it exactly as you wrote (using Spring REST API)

it is working ok now?

no

try to see this report as this sended user - open place when you have Roles button and on the right side we can also try to see report as an different user - if you add this username there report should be filtered

if it's not then format for username is different

if it's ok then we need to go deeper and see what you try to shoot to the server - you can for example download Embed-API-Sample-master application and modify it to use with your filters - then token what is generated can be used with js what show report at the webpage


I think I know where is the problem. In some way there is built bad request using spring RestTemplate. Probably are some issues with formatting the json from object.
When I ues json generated in the postman, working correctly.
I will continue the work on Monday. Anyway thanks a lot for your help.

Solved!
The issue was tha bad key in post json: "identitites" instead of "identities".
That bug was difficult to be discovered as the request gave back the correct response with the report token. But in the request body was taken only accessLevel and identities part has been ignored.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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