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
Anonymous
Not applicable

Web API Anonymous access

I am trying to connect to a Web API but am getting the error message

We couldn't authenticate wtih the credentials provided please try again and 

Use anonymous access for this Web content

 

I have gone into my data source settings and selected anonmous as suggested in other posts.

 

let
url = "https://website.auth0.com/oauth/token",

body = "{ ""client_id"": "xxxxx",
""username"": """ & Username_Parameter & """,
""password"": """ & Password_Parameter & """,
some other details
}",

tokenResponse = Json.Document(Web.Contents(url, [RelativePath="/oauth/token", Content = Text.ToBinary(body) ])),
AccessToken = tokenResponse[access_token],
AccessTokenHeader = "Bearer " & AccessToken
in
AccessTokenHeader

 

Any help would be appreciated as I have tried several different options. My query isnot working at the tokenResponse = Json line

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Depending on the error message you provided, this could be a permission/authentication error or an expired token. When you connect to a web data source from an unauthorized account, the appropriate credentials are created.

You can try deleting the previously created credential information and reconfiguring it at the screenshot location below, then connect to it and check if it succeeds.

vhenrykmstf_0-1664853343749.png

 

Or refer to below blog:

Chris Webb's BI Blog: Working with Web Services in Power Query Chris Webb's BI Blog (crossjoin.co.uk...


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

1 REPLY 1
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Depending on the error message you provided, this could be a permission/authentication error or an expired token. When you connect to a web data source from an unauthorized account, the appropriate credentials are created.

You can try deleting the previously created credential information and reconfiguring it at the screenshot location below, then connect to it and check if it succeeds.

vhenrykmstf_0-1664853343749.png

 

Or refer to below blog:

Chris Webb's BI Blog: Working with Web Services in Power Query Chris Webb's BI Blog (crossjoin.co.uk...


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

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.