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
dpm
Frequent Visitor

Generating an access token

I am generating an access token to use with the Power BI REST API but for users with MFA enabled that doesn't work.

 

Request: https://login.microsoftonline.com/common/oauth2/token
client_id: ...
grant_type: password
resource: https://analysis.windows.net/powerbi/api
username: ...
password: ...
client_secret: ...

Error message:
AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access

 

Is there any way to obtain the access token without disabling MFA?

 

Thank you in advance! 

4 REPLIES 4
WouterV
Frequent Visitor

through Powershell it can be done, have a look at module MicrosoftPowerBIMgmt

dpm
Frequent Visitor

Thank you Ilbendlin,

 

Disabling MFA is not an option unfortunately. I read answers from the second post but from what I can see SPN can't be used to obtain the access token needed. I've seen other applications offering the same functionality using the API and it was compatible for users with MFA enabled. Is it maybe possible to use the 'client_credentials' grant type for obtaining the access token somehow?

 

Thank you in advance. 

dpm
Frequent Visitor

If someone has come across this and the solution for this, I highly appreciated. Thanks for contributing ideas.

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.