Forum Discussion
Custom USERPRINCIPALNAME() when consumming API through Service Principal
- 3 years ago
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.
Hi Lauger ,
I mean, normally you use username to return the domain name and username in the credentials, and you could probably use it or some other like: userobject , instead of userprinciplename, which returns the email.
Best Regards
Gengar
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?