Forum Discussion

tenenwurcel's avatar
tenenwurcel
Regular Visitor
8 years ago
Solved

Doubt about embed token and filtering.

Hey everyone,   I am developing a web app using Power Bi Embedded (using javascript sdk), and I have two doubts.   1. It is still not clear how to get the access token. Should I just make a post ...
  • jamesyoung's avatar
    8 years ago

    Q1.  You can follow these instructions to generate a token.  You will need to know C#.

     

    https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-embedding-content/

     

     

    Q2. The filtering you are describing is called RLS(Row Level Security).  You can pass in role when generating your token request that would allow each client to see their own data.

     

    var generateTokenRequestParameters = new GenerateTokenRequest("View", null, identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: "username", roles: new List<string> { "roleA", "roleB" }, datasets: new List<string> { "datasetId" }) });
    
    var tokenResponse = await client.Reports.GenerateTokenInGroupAsync("groupId", "reportId", generateTokenRequestParameters);