Forum Discussion

mora11's avatar
mora11
Helper I
2 years ago

Paginated report embedded for your customer, RLS and CUSTOMDATA()

Hello,

I'm using Power BI Premium and additional web application with its own authentication. I have published Power BI report and I am using service principal to communicate Power BI service wit web application. I am passing a parameter from web app to PBI service to know, who is logged in and I am reading that information using CUSTOMDATA() for RLS purposes. It works perfectly well.

However, I have published Paginated Report with very same set up and it turned out CUSTOMDATA() retreives null, USERPRINCIPALNAME() and USERNAME() both retreive my login as a report publisher for each logged in user and built in (native) Report Builder function UserID retreives the same string for each logged user as well (it may be my GUID). Question: How to retreive in Paginated Report who is logged in to web app? How to get the same information like CUSTOMDATA() in Power BI but in Report Builder?


Thanks

5 Replies

    • mora11's avatar
      mora11
      Helper I

      Thanks for your answer. I have read that article and I don't quite get that part about token generation. Currently in my case UserID function retreives string like the following pattern "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" and it displays the same for each user. What will change after token generation? UserID will retreive different values for each user? Should I generate token for each and every user? I just need to know who is logged to my custom web application. Thanks

       

      • d_gosbell's avatar
        d_gosbell
        Super User

        mora11 wrote:

        What will change after token generation?


        You must currently be generating a token for the embedding to be work, you just need to push the value you are injecting into the CustomData into the User value for the token.


        mora11 wrote:

        Should I generate token for each and every user?


        Yes, you should be doing this already


        mora11 wrote:

         I just need to know who is logged to my custom web application. Thanks


        Your app should already know this as it should be doing it's own authentication. What you need to do to get the RLS to work with a paginated report is to push the value you want to use for filtering in your RLS rule into the User field so that this can be passed on from the paginated report to the dataset UserName() function.