Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nasirali
Helper I
Helper I

Updating Power BI Web Data source Bearer Token via power BI SDK

I have created a power BI report with web datasource, which is getting data from my Web Api using bearer token. I have hard coded the api token inside header. Also I have embedded the report inside my Asp.net MVC project using power BI SDK. Everything is working fine. 

 

But i want to make my report dynamic, in the sense that i want to change the bearer token according to logged in user. So my question is: Is it possible to change the Web Datasource authentication token via Power BI SDK. As i want to pass my logged in user's token to report. so that the user sees only his data. Or how can i achieve something similar to that? Thanks.

1 ACCEPTED SOLUTION

Thanks for reply. I read the link you suggested. I want to, sort of, acheive that. I am new to Power BI but from the links it is seems like Row level security works with Power BI users. Am i right?

 

I am developing an application where App Owns Data. Report is embedded inside MVC application and data for the report is coming from Web Api and i want to retrieve data based on user who is logged inside MVC application. Can we some how use that user info?

 

The only other way i have found so far is to pass user related data inside Filters using powerbi.embed configuration. Any comments will be highly appreciated?

 

 

Regards

View solution in original post

2 REPLIES 2
v-sihou-msft
Employee
Employee

@nasirali

 

In Power BI, it's not possible to dynamically populating the current login user bearer token in Power BI Embedded. To have each user see their own data, you just need to configure Row Level Security. You can apply row level filter with USERNAME() function. For more details, please refer to tutorials below:

 

Dynamic Row Level Security with Power BI Made Simple

Power BI – Dynamic Row Level Security – Tips to get it working!

Row Level Security In Power BI

 

Regards,

 

 

Thanks for reply. I read the link you suggested. I want to, sort of, acheive that. I am new to Power BI but from the links it is seems like Row level security works with Power BI users. Am i right?

 

I am developing an application where App Owns Data. Report is embedded inside MVC application and data for the report is coming from Web Api and i want to retrieve data based on user who is logged inside MVC application. Can we some how use that user info?

 

The only other way i have found so far is to pass user related data inside Filters using powerbi.embed configuration. Any comments will be highly appreciated?

 

 

Regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.