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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.