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
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
Employee
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
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.

Top Solution Authors
Top Kudoed Authors