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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Marcus_Dev1337
Frequent Visitor

Power BI Rest API Authentification wrong active directory

Hi Guys,
I'm playing around with the Power BI Rest API ( https://github.com/Microsoft/PowerBI-CSharp ).

I have the following problem:
When I connect (use the access token) to my Developer-Account 'xy@myCompany.otherCompany.de' I recieved from a company I work with (otherCompany), I get an access token for my personal Company Account [xy@myCompany.de].
So I can only work in this workspace via the Rest API.

I use the right login for the 'xy@myCompany.otherCompany.de'- Account.
The client is register for the right account  (xy@myCompany.otherCompany.de).

When I login (xy@myCompany.de) in the Azure portal, I can see that the accounts xy@myCompany.de and xy@myCompany.otherCompany.de are connected.

Any ideas why this happens and how I can work with the active directory I want ?
I guess it's an administrativ problem, but I dont know who have to fix this.
Or even how the administrator can fix this.

I hope my english is understandable Smiley Frustrated


Thanks in advance ,
Marcus

2 REPLIES 2
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Marcus_Dev1337,

 

Are you using the "App Owns Data" or "User Owns Data" sample? Could you post the detailed error message here?

 

In addition, could you try logging in the Azure portal with the 'xy@myCompany.otherCompany.de'- Account, to register your application and grant permissions, to see if it works?

 

Regards

Hi @v-ljerr-msft,

"Are you using the "App Owns Data" or "User Owns Data" sample?"
I use the "User Owns Data" sample.

"Could you post the detailed error message here?"
There is not error Message. I just see the wrong Reports.

"In addition, could you try logging in the Azure portal with the 'xy@myCompany.otherCompany.de'- Account, to register your application and grant permissions, to see if it works?"
I already did that  😉
It actually works, BUT I'm in the wrong account context.
I'm in the context : 'xy@myCompany.de' instead of 'xy@myCompany.otherCompany.de'

For better explanation:
'xy@myCompany.de' has Report 1 and Report 2
'xy@myCompany.otherCompany.de' has Report 3 and Report 4

I create the Client-ID nd use the login for 'xy@myCompany.otherCompany.de'.
This already works, but when I request the list of reports I get Report 1 and Report 2. That's wrong.

One think I saw is:
When I create a Client-ID with Client-Secret and use this Client-ID and the Client-Secret for using the REST API.
Then I get Report 3 and 4. That's correct.


Regards

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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