PowerBI Embed Custom Filters Secured? - powerbi

I am working on a project where we need to embed a Power BI Report in to React application.
We are generating a token using service principal with that we are loading the embed report
We are using a single multitenant database so we have all customer info in the single database.
For some reason I couldn't not use RLS filtering. I want to use custom filters to filter the Embeded Report.
Is the custom filter is secured? If I access the report embed url directly then it is not loading anything, so can I consider generating token and connecting embed report is secured option?
I want to know custom filtered option is secured or not.

Is the custom filter is secured?
It's a Javascript API, so it runs in the user's browser, and so it's not secured.
We are using a single multitenant database so we have all customer info in the single database.
In this scenario either use RLS or create separate Datasets for each tenant.
Securing your data
If you're handling data from multiple customers, there are two main
approaches to securing your data: Workspace-based isolation and
Row-level security-based isolation. You can find a detailed comparison
between them in service principal profiles and row level security.
We recommend using workspace-based isolation with profiles, but if you
want to use the RLS approach, review the RLS section at the end of
this article.
Generate an embed token - Securing your data

Related

After using Custom Authorization in Power BI report server, I cannot add the group in the Row level security section

After use Custom Authorization in power bi report server in Row level security part cannot assign group of database And also I checked the codes of Authorization.cs, AuthenticationUtilities.cs and AuthenticationExtension.cs classes, I didn't find a method related to Row level security that I can develop.
I was able to develop the security part that checks the permission of each report based on the group and users of my database, but I ran into trouble in the Row level security part and I did not find a method to develop.
there is no way to handle groups in RLS in custom auth.
https://github.com/microsoft/Reporting-Services/issues/188
and
If you're using custom authentication in Power BI Report Server, [USERNAME()] returns the username format you’ve set up for users.
Row-level security (RLS) in Power BI Report Server
So in your model you set up RLS rules based on the username format you passed from your custom auth extension.

One embedded Token for multiple visuals or pbi reports (pbi embedded)?

Do you know if i can use one generated token for embed multiple visuals or reports from diferent workspaces in the same pbi account? I am using pbi embedded (app owns data). I want to use just one generated token, is it posible?
To embed multiple reports / visuals using single embed token, you can use multi-resource embed token. Using that, A token can be generated that can be used for multiple reports, datasets and target workspaces.
You need to make POST request to https://api.powerbi.com/v1.0/myorg/GenerateToken with request body which contains, datasets, reports and workspaces.
This API is only supported for App owns data scenario.
Please refer:
https://learn.microsoft.com/rest/api/power-bi/embed-token/embed-token-generate-token
https://github.com/microsoft/PowerBI-Developer-Samples (these samples use the multi-resource embed token to embed reports)

How to apply filter in PowerBI WebApp

I have created one WebApp which is hosted on Azure IIS. I am calling PowerBI reports & Dashboards and rending them into my WebApp.
I need to apply following functionality and I am unable to find solution online.
Users can filter the data from filters available in PowerBI from Web Application.
Row Level Security can be applied when we call PowerBI reports and render into web page.
It is not clear what kind of URL you are using to embed the reports. Essentially, there are 3 URLs that you can use to display a report in your web app:
The URL taken from your browser's address bar. In this case the use of you web app needs to be logged in Power BI service and to be granted with rights to see this report. One of the disadvantages are that in your web app you will not see the report only, but the whole Power BI page (including the navigation menu at the left).
The URL taken when you share this report publicly using Publish to web. In this case only the report will be embedded in your web app (menus will not be visible), but you can't do that for reports over RLS enabled datasets (because RLS requires user's identity, while in this case the access is anonymous).
The embedUrl of the report (or tile, or dashboard) that you can obtain using the Power BI REST API. It is usually used when you have a dedicated capacity assigned to this workspace (Power BI Embedded). In this case there are two scenarios - "User own data" and "App own data". In the first one each of your users must have their own account and rights to see the report (as in #1). In the later scenario, you use one shared "master account" in your web app to get access to the report and there is no need for your users to authenticate themselves. You can take a looks at the samples to see how it works. Essentially, you need the JavaScript Power BI client, one HTML page with a and some JavaScript code to load the report in the (check powerbi.js, ReportLoader.html and ReportLoader.js files from the samples. A good place to start is this article - Tutorial: Embed a Power BI report, dashboard, or tile into an application for your customers.
To apply filters to the embedded report, you can use one of the recently new features (if I'm correct, it is available since August 2018) and add the filters in the URL. I'm not sure will this work in case #2, but I will not recommend using it anyway.
RLS is not possible with case #2. In cases #1 and #3 RLS will simply work. With #3 if you use "app own data" scenario, for the RLS to work you need to pass user's name and role when you generate the token to access the report (because otherwise for all user's requests Power BI will always see the identity of your "master account" and RLS will not make any sense). This is specified with EffectiveIdentity parameter.
You also attached "power-bi-report-server" to your question, but at the same time you are saying that your web app is running in Azure. If after all your reports are on Power BI Report Server on premise, then you can embed reports by passing rs_embed=true parameter at report's URL too. In this case to make RLS work you just need to make sure that your users are authenticated with their own accounts. Passing filters in the URL works with the recent versions too (it was broken in March 2018, but fixed in 15.0.2.389).

Is there a way to pre-filter a powerBI report server side?

I have uploaded a report, and using the .net SDK I've embedded said report into my website. However we show private data for many organizations. If I edit the reports iframe url to filter the report by the users org id so they can only see data for their organization then that ends up being a URL you can edit in javascript on the client side so a use could put another id there and view some other organizations data.
Is there any way possible to filter the data a report shows before it is sent client side?
I know you can edit the report file it'self but if you have hundreds of organizations, you'd need 100 copies of the same report which is obviously a maintenance and upkeep nightmare.
I would use the "Row Level Security" (RLS) feature for this requirement. Basically you set up roles, assign users to them and assign DAX expressions to them to filter the data.
There's a good explanation of it here:
https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-rls/
The most efficient design of RLS (from a coding and admin perspective) is if you can feed in a username variable and filter your data by that (as shown in that example).

How to get all Users and Roles information from Liferay in other applications?

I am developing a C# program and I need to show Users and Roles list in it from Liferay database.
Is there any service to fetch these information for me?
You should check out the Liferay JSON Web Services to get this kind of information (without having to query the DB directly).
If you go to http://your-liferay-server-url.com/api/jsonws you can see all the Web Service end points that Liferay provides, and that you can make calls to.
If you however want to directly query the Liferay database then look at the following tables:
groups_roles
groups
role_
user_
users_roles
usergrouprole
That should be all of the tables in the DB that you need to get the info, and you may not even need all of those tables for what you need.