This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
We display reports to users of our SaaS application by embedding them. The config to get the embed url uses a Service Principal.
For a time we have been using a JavaScript filter to filter report data based on a user's group. This is problematic because a user could potentially hack it and see other groups data.
We have attempted to implement Row Level Security (RLS) while getting the embed token using the code below.
Each user does not have a user account in AAD, so we want to use the Service Principal of the Enterprise Application registered in AAD that we use to get the access token for talking to the api.
Using the C# SDK no matter what username I put in to the EffectiveIdentity it returns a status code of 'Unauthorized'.
Have tried:
Has anyone else had experience with this and can give me an idea what value should be used for the username property?
var tokenRequest = new GenerateTokenRequestV2(
reports: new List<GenerateTokenRequestV2Report>() { new GenerateTokenRequestV2Report(reportId) },
datasets: datasetIds.Select(datasetId => new GenerateTokenRequestV2Dataset(datasetId.ToString())).ToList(),
targetWorkspaces: targetWorkspaceId != Guid.Empty ? new List<GenerateTokenRequestV2TargetWorkspace>() { new GenerateTokenRequestV2TargetWorkspace(targetWorkspaceId) } : null
);
tokenRequest.Identities = new List<EffectiveIdentity> {
new EffectiveIdentity("[Service Principal Object Id]"
// //,reports: new List<string>() { reportId.ToString() }
,datasets: datasetIds.Select(datasetId => datasetId.ToString()).ToList()
// ,roles: new[] { "CommunityAdmin" }
// //, customData:"0ea41e5e-13aa-4a15-8fdc-a7b152dfb089"
)
};
Solved! Go to Solution.
Hi @WayneT ,
As mentioned in this official documentation:
Applying user and role to an embed token
Best Regards
Hi @WayneT ,
As mentioned in this official documentation:
Applying user and role to an embed token
Best Regards
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |