User Profile
Lauger
Regular Visitor
Joined 4 years ago
User Widgets
Contributions
Re: Custom USERPRINCIPALNAME() when consumming API through Service Principal
It took me a long time before being able to figure out the best solution. Using service principal was not the best approach in order to take the user's rights in account. So I had to focus on the other way (more complicated for novice as I am) to embed reports, based on user's scope delegation located in the Azure application.3KViews0likes0CommentsRe: Custom USERPRINCIPALNAME() when consumming API through Service Principal
Hi Gengar, Thanks for your reply. I will check what does the DAX function USERNAME() as soon as possible (I'm waiting feedback from other teams of my company), thanks a lot. If it works, I will mark your answer as the solution. To well understand, how can Power BI retrieve the name of the user authenticated on the application? As I authenticate to API using a Bearer token authentication mode refering the Service Principal access token, I'm wondering how it's possible to retrieve the user's name?3.1KViews0likes0CommentsRe: Custom USERPRINCIPALNAME() when consumming API through Service Principal
Hi Gengar, Thanks for your reply. To make sure I understand well, USERNAME() DAX function will return the name of the authenticated user. However, as a generate an access token using Azure App client ID and secret, will it not simply return the username of the Azure app? The report's embed token is generated using the Access Token generated for the Azure app. How can PowerBI retrieve the currently-authenticated user's information if I never send his own credentials anywhere? And what will return USERNAME() function if I embed a report into an application which uses Anonymous authentication mode? Thanks a lot. Regards,3.2KViews0likes2CommentsCustom USERPRINCIPALNAME() when consumming API through Service Principal
Hi, I have to embed some Power BI reports in several applications. I use an Azure Service Principal (client id, client secret) to generate an access token and call the Power BI API. All is working fine. However, some reports implement custom rights management through RLS using the user's email (provided by USERPRINCIPALNAME() DAX function) and Datamart tables (wich do relations betweens the email and the data the user can access). As I'm authenticating to the PowerBI API with an Azure app, the DAX function will not return the email of the user that browses the report. To give more context: - our applications are working on IIS server; all of them require Windows authentication; the user is authenticated in SSO mode when accessing the web app. - I get the access token and the report's embed token in Javascript (front-end approach). I would like to know what is the best solution to face this issue? How can I pass the service principal off as the real authenticated user? Thanks a lot for your help. Regards,Solved3.2KViews0likes7Comments
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.