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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
r_beacroft
Frequent Visitor

Power BI Desktop - Unable to pull from OData feed using Token authentication

Hi,

 

Am newbie to Power BI.

 

We have an OData feed that supports token authentication.

i.e. requests contain a header with "Authorization Token [guid]"

 

How can I configure Power BI to be able to call ourOData feed?

Is this possible?

 

Kind Regards,

Rik

1 ACCEPTED SOLUTION

Hi @r_beacroft,

If you connect to OData feed using the following entry, and then enter your password, are you able to get desired result?
1.PNG

If not, add a new blank query in Power BI Desktop, then paste one of the following codes in Advanced Editor and check if you get expected result.

let 
Source = OData.Feed("URL", null, [Headers = [Authorization = "Bearer Your token" ] ])
in
Source

 

let    
Source = Web.Contents("URL", [Headers=[#" Authorization  " = "Bearer Your token"]])
in
Source

 

There are a similar thread and blog for your reference.
http://stackoverflow.com/questions/33225590/authenticating-with-excel-power-query-against-net-odata-...
http://angryanalyticsblog.azurewebsites.net/index.php/2016/05/16/api-strategies-with-power-bi/

 

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
r_beacroft
Frequent Visitor

Hi,

 

Am newbie to Power BI.

 

We have an OData feed that supports token authentication.

i.e. requests contain a header with "Authorization Token [guid]"

 

How can I configure Power BI to be able to call ourOData feed?

Is this possible?

 

Kind Regards,

Rik

Hi @r_beacroft,

If you connect to OData feed using the following entry, and then enter your password, are you able to get desired result?
1.PNG

If not, add a new blank query in Power BI Desktop, then paste one of the following codes in Advanced Editor and check if you get expected result.

let 
Source = OData.Feed("URL", null, [Headers = [Authorization = "Bearer Your token" ] ])
in
Source

 

let    
Source = Web.Contents("URL", [Headers=[#" Authorization  " = "Bearer Your token"]])
in
Source

 

There are a similar thread and blog for your reference.
http://stackoverflow.com/questions/33225590/authenticating-with-excel-power-query-against-net-odata-...
http://angryanalyticsblog.azurewebsites.net/index.php/2016/05/16/api-strategies-with-power-bi/

 

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

In Power BI Desktop it works fine. But after publishing and trying to schedule automatic refresh I don't get a connection. Edit credentials

 

What exactly do I have to provide in the credentials in Power BI Service?

I tried several methods with/without "" but get "The credentials provided for the OData source are invalid"   

Status code:400

 

I used:

Authentication method

Key

 

Account key

Bearer ........

 

Privacy level setting for this data source

Organizational

 

I also tried: 

"Bearer ........."

 

What do I wrong?

 

 

 

bavix
Frequent Visitor

SOLVED

I had to use "Anonymous", "Organizational" and skip connection test

Hey Bavix, I am trying to do a similar solution, maybe you did it in PowerBi Report Server Locally. Where did you set the Organizational option and skip the connection test?

Thank you 

bavix
Frequent Visitor

Hi kdhawan,

I was activating the automatic refreshing in PBI Service, not in Report Server.

bavix_0-1705010781340.png

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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