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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ljfoster97
Regular Visitor

OData Feed using basic authentication "We couldn't authenticate with the credentials provided."

We have about a dozen reports that use an OData feed exposing different SQL SmartObjects.

Recently, reports have gradually been starting to fail to refresh in the PowerBI Service with the "We couldn't authenticate with the credentials provided. Please try again." error. Notably, all reports use the exact same credentials for the OData feed, and some models even access the same SmartObjects, but in these cases it's totally random as to whether the report will start failing to refresh and throw the credential error or not. When the report fails to refresh in the service once it continues to fail even when manually refreshing in PowerBI Desktop.

I am consistently able to access the OData feed via web browser using the exact same credentials without any issues, and have confirmed this for all relevant SmartObjects. 

I have tested accessing the OData feed via PowerQuery in Excel, which seems to work intermittently, but often results in the same error. Sometimes I can view and select the preview tables, but will receive the authentication error once I try to load/transform the data. 

I managed to get one report working temporarily by changing the "select which level to apply these settings to" for every query to be the full URL/path of the relevant SmartObject for that Query (one entry per query in Data Source Settings) but this then also started failing to refresh the next day. 

I have tested on two different devices, different internet connections, have tried uninstalling and reinstalling PowerBI Desktop and the issues persisted.


2 ACCEPTED SOLUTIONS
v-dineshya
Community Support
Community Support

Hi @ljfoster97 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Please check below solutions.

1. Credential Scope Reset
Fully remove all cached credentials: Go to Power BI Desktop → File → Options and Settings → Data Source Settings.
Remove all entries related to the OData feed (root and full path). Restart Power BI Desktop. When re-connecting, apply Basic Auth credentials at the exact full path level (e.g., https://server/odata/SmartObject.svc/Name) rather than the root URL. Ensure all queries use credentials at this level not at the domain level.

Then repeat the same in Power BI Service: Go to Settings → Datasets → Data Source Credentials. Delete and re-add credentials using Basic Auth. Ensure privacy level is set to “Organizational” or “None”.

2. Prevent Credential Inheritance Conflicts
In the Query Editor, check that each query source is using the exact same scoped level. Avoid mixing different levels  e.g., https://server/odata/ vs https://server/odata/SmartObject.svc/.

3. Avoid Combine Data Sources
If you're combining data from multiple SmartObjects or sources, disable the “Fast Combine” option, or restructure to avoid merging unrelated sources. Go to File → Options → Privacy → Ignore privacy levels, if your org policy allows.

4. Create a Gateway Connection
If you're refreshing in Power BI Service: Use an on-premises data gateway with Basic Auth configured for OData. Sometimes the Service handles direct-to-web Basic Auth poorly without a gateway.

5. Monitor Server Logs / K2 Backend
Check with your admin: Any security or patch updates on the K2 or OData hosting server? Are there any rate limits, IP blocks, or 401 responses logged?

6. Use Web.Contents with Headers
As a last resort, try building your query manually using Web.Contents with headers:

M code

let
source = Web.Contents(
"https://server/odata/SmartObject.svc/Name",
[
Headers = [
#"Authorization" = "Basic " & Binary.ToText(Text.ToBinary("username:password"), BinaryEncoding.Base64)
]
]
),
data = OData.Feed(source)
in
data

Note: Replace "username:password" with your actual credentials. This can avoid some of the caching/token issues.

 

Please refer community threads and articles.

Solved: Get ODATA - We couldn't authenticate with the cred... - Microsoft Fabric Community

Solved: Cannot authenticate with the credentials provided ... - Microsoft Fabric Community

Solved: Credentials ODATA feed in Power Bi Online - Microsoft Fabric Community

Solved: OData credentials not working in Power BI Desktop;... - Microsoft Fabric Community

Solved: We couldn't authenticate with the credentials prov... - Microsoft Fabric Community

Power Query OData Feed connector - Power Query | Microsoft Learn

Client authentication options - Azure DevOps | Microsoft Learn

We couldn't authenticate with the credentials provided. Please try - Microsoft Community

Troubleshooting OData sign-in errors in Power BI Desktop - Power BI | Microsoft Learn

Correct Power BI Connection on Prem

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

View solution in original post

Ritaf1983
Super User
Super User

Hi @ljfoster97 

This sounds like a classic case of inconsistent credential handling between Power BI Desktop and the Service, especially when using Basic Authentication.

Here are a few things to verify:

1. Clear cached credentials
In Power BI Desktop: *File > Options > Data Source Settings*. Locate the OData feed, delete the credentials, and reconnect using Basic Auth. Also make sure the *Privacy Level* is set to "Organizational" or "None", not "Private".

2. Make sure your PBIX doesn’t reference local files
Even a single local Excel or CSV file in the model can cause the entire scheduled refresh to fail in the Service, regardless of the main data source.

3. Check for HTTP redirects or short-lived sessions
If the OData feed uses redirects (like HTTP 302), the Power BI Service may fail to resend credentials. Similarly, some servers silently expire sessions or throttle repeated requests, which might explain the inconsistent failures.

4. Try configuring a data gateway
If the OData source is internal or restricted by IP, routing the refresh through an on-premises data gateway may solve the issue.

5. Avoid relying on SmartObject behavior
If you're using K2/Nintex SmartObjects, note that these platforms have known issues when consumed via Power BI, especially around credential persistence and OData versioning.

6. If none of this helps – open a Microsoft support ticket
You may be hitting a backend authentication bug in the Service. Microsoft Support can help investigate server-side logs that aren’t accessible otherwise.

If this post helps, then please consider Accepting it as the solution and giving Kudos to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

6 REPLIES 6
Ritaf1983
Super User
Super User

Hi @ljfoster97 

This sounds like a classic case of inconsistent credential handling between Power BI Desktop and the Service, especially when using Basic Authentication.

Here are a few things to verify:

1. Clear cached credentials
In Power BI Desktop: *File > Options > Data Source Settings*. Locate the OData feed, delete the credentials, and reconnect using Basic Auth. Also make sure the *Privacy Level* is set to "Organizational" or "None", not "Private".

2. Make sure your PBIX doesn’t reference local files
Even a single local Excel or CSV file in the model can cause the entire scheduled refresh to fail in the Service, regardless of the main data source.

3. Check for HTTP redirects or short-lived sessions
If the OData feed uses redirects (like HTTP 302), the Power BI Service may fail to resend credentials. Similarly, some servers silently expire sessions or throttle repeated requests, which might explain the inconsistent failures.

4. Try configuring a data gateway
If the OData source is internal or restricted by IP, routing the refresh through an on-premises data gateway may solve the issue.

5. Avoid relying on SmartObject behavior
If you're using K2/Nintex SmartObjects, note that these platforms have known issues when consumed via Power BI, especially around credential persistence and OData versioning.

6. If none of this helps – open a Microsoft support ticket
You may be hitting a backend authentication bug in the Service. Microsoft Support can help investigate server-side logs that aren’t accessible otherwise.

If this post helps, then please consider Accepting it as the solution and giving Kudos to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

5. Avoid relying on SmartObject behavior
If you're using K2/Nintex SmartObjects, note that these platforms have known issues when consumed via Power BI, especially around credential persistence and OData versioning.

Do you have any references or additional resources for this statement? I've already tried clearing cached credentials many times and the data model doesn't reference any local files. 

v-dineshya
Community Support
Community Support

Hi @ljfoster97 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Please check below solutions.

1. Credential Scope Reset
Fully remove all cached credentials: Go to Power BI Desktop → File → Options and Settings → Data Source Settings.
Remove all entries related to the OData feed (root and full path). Restart Power BI Desktop. When re-connecting, apply Basic Auth credentials at the exact full path level (e.g., https://server/odata/SmartObject.svc/Name) rather than the root URL. Ensure all queries use credentials at this level not at the domain level.

Then repeat the same in Power BI Service: Go to Settings → Datasets → Data Source Credentials. Delete and re-add credentials using Basic Auth. Ensure privacy level is set to “Organizational” or “None”.

2. Prevent Credential Inheritance Conflicts
In the Query Editor, check that each query source is using the exact same scoped level. Avoid mixing different levels  e.g., https://server/odata/ vs https://server/odata/SmartObject.svc/.

3. Avoid Combine Data Sources
If you're combining data from multiple SmartObjects or sources, disable the “Fast Combine” option, or restructure to avoid merging unrelated sources. Go to File → Options → Privacy → Ignore privacy levels, if your org policy allows.

4. Create a Gateway Connection
If you're refreshing in Power BI Service: Use an on-premises data gateway with Basic Auth configured for OData. Sometimes the Service handles direct-to-web Basic Auth poorly without a gateway.

5. Monitor Server Logs / K2 Backend
Check with your admin: Any security or patch updates on the K2 or OData hosting server? Are there any rate limits, IP blocks, or 401 responses logged?

6. Use Web.Contents with Headers
As a last resort, try building your query manually using Web.Contents with headers:

M code

let
source = Web.Contents(
"https://server/odata/SmartObject.svc/Name",
[
Headers = [
#"Authorization" = "Basic " & Binary.ToText(Text.ToBinary("username:password"), BinaryEncoding.Base64)
]
]
),
data = OData.Feed(source)
in
data

Note: Replace "username:password" with your actual credentials. This can avoid some of the caching/token issues.

 

Please refer community threads and articles.

Solved: Get ODATA - We couldn't authenticate with the cred... - Microsoft Fabric Community

Solved: Cannot authenticate with the credentials provided ... - Microsoft Fabric Community

Solved: Credentials ODATA feed in Power Bi Online - Microsoft Fabric Community

Solved: OData credentials not working in Power BI Desktop;... - Microsoft Fabric Community

Solved: We couldn't authenticate with the credentials prov... - Microsoft Fabric Community

Power Query OData Feed connector - Power Query | Microsoft Learn

Client authentication options - Azure DevOps | Microsoft Learn

We couldn't authenticate with the credentials provided. Please try - Microsoft Community

Troubleshooting OData sign-in errors in Power BI Desktop - Power BI | Microsoft Learn

Correct Power BI Connection on Prem

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

Hi @ljfoster97 ,

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

Hi @ljfoster97 ,

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

Hi @ljfoster97 ,

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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