Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

API Authentication Issue



I am struggling to get Basic authentication working with a REST API.


I keep getting the very generic error "We couldn't authenticate with the credentials provided." I have verified multiple times that the credentials are correct, and they also work when I use the URL in a browser.


There's nothing unusual about this API, it's a standard REST API with JSON output.


I opened up Fiddler and watched the process when I try to submit the credentials. The authorization header does appear and is correct. The initial response is an HTTP 307 so Power BI is following this redirect, but in the subsequent call the Authorization header is dropped resulting in a 401 which is why I believe I'm getting the error message.


Any thoughts on how to get past this or troubleshoot to see if something else might be causing the authentication failure? Or is there a way to get Power BI to maintain the Authorization header through the redirect?



Community Support
Community Support

Re: API Authentication Issue

Hi @bbdiitmanager ,

Maybe you can clear the permissions in 'Data source and settings' in power bi desktop and try it again.

Also, you can refer these article and issue that hopes to help you too:

  1. Easiest way of connecting Power BI to a REST API with Oath2 authentication 
  2. 401 Unauthorized Error: What It Is and How to Fix It 
  3. HTTP 401 Unauthorized by using PowerBi rest api 


Best Regards,
Yingjie Li

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Regular Visitor

Re: API Authentication Issue

Thanks for the replies! Unfortunately, none of the links provided covered the symptoms I am experiencing. They are more generic "how to authenticate" threads which is not quite the issue I am experiencing.

Regular Visitor

Re: API Authentication Issue

Follow up:


I can reproduce the issue in Postman by turning off "Automatically follow redirects".


Seems to me that Power BI is not following 3xx status codes.


I found this thread: but there's no solution.


Any ideas?



Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors