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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
mrvamsidhar
Helper I
Helper I

Connecting REST API with OAUTh authentication

We are having internal application RestAPI calls authenticated with my company Azure AD with OAuth2 . I can able to make those call from browser. But how can I make call those API's from Power-BI desktop application?

I tried with all Authentication mechanisms. I am getting error message saying "Access to resource is forbidden".

  1. Is oAuth2 supported by Power-BI?
  2. How can i connect to the rest api calls?

 

Thanksin advance

 

5 REPLIES 5
v-yuta-msft
Community Support
Community Support

Hi mrvamsidhar,

 

Yes, power bi support OAuth, please click Query Editor-> Advanced editor then use web.content() function. Please refer to these blogs for more detail about how to make http request in power bi desktop with OAuth:

http://bi-fu.net/pbi/add-headers-for-oauth2-in-power-query-web-contents-for-power-bi/

https://prathy.com/2017/09/calling-power-bi-api-using-power-bi-desktop-to-document-power-bi-service/

https://stackoverflow.com/questions/40753188/google-oauth-refresh-tokens-in-power-query

https://wiki.zansha.space/index.php/SSO_Authentication_in_Microsoft_Power_Query

 

Regards,

Jimmy Tao

 

Thanks Jimmy. I was succedded little bit. All these urls provided below showed hot to use Temporary cookie. At the same time, Our rest API's are using Cookie based Authentication. I am able to use existing token which I got from browser and able pull data.

 

  1. So is it possible to create a authorization cookie using M query and pass cookie details to REST API instead using existing cookie? 

 

 

Hi mrvamsidhar,

 

I'm afraid you can't create cookie using power query because power query can only get data, but can't output cookie files.

 

Regards,

Jimmy Tao 

So, is there a way i can acheive this?

All i want is to call these rest apis from powerbi and publish the report.

Are there any other alternatives?

Can some one help me with this? Our REST API's are using OAuth with AZure teantid. After login with Azure credential, my rest api's works fine in my broswer. But when I open the rest api's in my powerbi, it is asking not working. But, If i provide cookie from the browser to the powerbi (GetData->Web->Advanced) it is giving data. I like to implemt OAuth in my powerbi desktop.

 

Can it be done via connectors or power query?

How to get Authorize token for azure in power query ( I have tenant id)

 

 

 

 

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.