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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
mikegoatly
Frequent Visitor

Connecting to an API with basic authentication and custom header

We're trying to connect to an API that requires both basic auth and a custom header called "clientid".

 

The data source is configured with basic authentication, and the clientid header is passed through with the web request, like this: 

Source = Web.Contents("...", [Headers=[clientId="..."]])

When configured in this way, Power BI refuses to even execute the API call, giving the error:

clientid header is only supported when connecting anonymously. 
These headers can be used with all authentication types: 
Accept, Accept-Charset, Accept-Encoding, Accept-Language, Cache-Control, Content-Type, If-Modified-Since, Prefer, Referer

So it would seem that Power BI has a safe list for headers that can be used with authentication, and anything that falls outside that is blocked? Assuming there's no other way to inject a custom header into an authenticated request, this means that there's no way for us to make a request to APIs with these requirements.

 

Is there any way to make a request like this successfully?

 

(There is a similar post over here that never got a satisfactory response - to be clear, turning off authentication is not an option!)

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @mikegoatly ,

 

Based on my research, there is no way to keep the custom header with basic authentication in basic web connector (As the error message say), here is a similar post.

 

You can come up a new idea and add your comments there to make this feature coming sooner. https://ideas.powerbi.com/forums/265200-power-bi-ideas

 

Best regards,

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

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

I figured as much, but thanks for confirming.

 

For reference I've createed the idea here: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/38624035-allow-custom-headers-for...

 

Kind regards,

Mike

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.