Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Using Customdata with live connection to on-prem SSAS

Hi All,

 

I'm implementing a Power BI Embedded solution having a live connection to my on-prem SSAS. I want to define roles based on my application username. I followed this blog : https://www.kasperonbi.com/using-customdata-and-ssas-with-power-bi-embedded/

 

The solution works fine in the service, I can see using SQL Server Profiler that the customdata has been passed. But when calling the API for the embed token, I get the following error: 

Operation returned an invalid status code 'Forbidden'

I noticed while debugging that the customdata value hasn't been passed and it's always null.

 

I use the following to generate the token:

var generateTokenRequestParameters = new GenerateTokenRequest("View", identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: currentUserName, roles: new List<string> { "RoleA" }, datasets: new List<string> { "b1ff16fc-aa63-49a3-8cb6-cad785b228f7" }) });
string embedToken =
(await pbiClient.Reports.GenerateTokenInGroupAsync(workspaceId,
report.Id,
generateTokenRequestParameters)).Token;

 

Can you help me troubleshoot this issue, a quick answer would be much appreciated. 

 

Best, 

2 Replies