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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Error accessing data from Web

Hi,

 

I am trying to fetch data from https://qualysguard.qualys.com . I try connecting via Get data-> Web. Then i passed credential using Basic. I am getting below error. Can anyone help me out here

 

DataSource.Error: Web.BrowserContents currently supports only anonymous credentials.

 Regards,

Nidhya

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

That error means that the site does not accept connections made with a username and password entered in Power BI through this dialog 

basic-auth.png

 

It's saying you must connect to it Anonymously

anon-auth.png

 

If the site requires authenticationthen you probably need to pass it in the request headers like this

 

    api_url = "https://qualysguard.qualys.com/",
    ClientID = "xxxxxxxx",
    Secret = "xxxxxxxx",
    
    EncodedCredentials = "Basic " & Binary.ToText(Text.ToBinary(ClientID & ":" & Secret), BinaryEncoding.Base64),
    
    Response  = (Web.Contents(api_url,
    [ 
      Headers = [#"Content-Type"="application/x-www-form-urlencoded",#"Authorization"=EncodedCredentials],
      Content=Text.ToBinary("grant_type=client_credentials")
    ]
    )
    )

 

 

But that might not be exactly correct because I don't know how the site requires an authenticated connection to be made.

If you can supply further info on exactly how the site expects a connection I can help out some more.  Does the site provide API documentation?

regards

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
PhilipTreacy
Super User
Super User

Hi @Anonymous 

That error means that the site does not accept connections made with a username and password entered in Power BI through this dialog 

basic-auth.png

 

It's saying you must connect to it Anonymously

anon-auth.png

 

If the site requires authenticationthen you probably need to pass it in the request headers like this

 

    api_url = "https://qualysguard.qualys.com/",
    ClientID = "xxxxxxxx",
    Secret = "xxxxxxxx",
    
    EncodedCredentials = "Basic " & Binary.ToText(Text.ToBinary(ClientID & ":" & Secret), BinaryEncoding.Base64),
    
    Response  = (Web.Contents(api_url,
    [ 
      Headers = [#"Content-Type"="application/x-www-form-urlencoded",#"Authorization"=EncodedCredentials],
      Content=Text.ToBinary("grant_type=client_credentials")
    ]
    )
    )

 

 

But that might not be exactly correct because I don't know how the site requires an authenticated connection to be made.

If you can supply further info on exactly how the site expects a connection I can help out some more.  Does the site provide API documentation?

regards

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


AllisonKennedy
Super User
Super User

I'm not sure, as I don't have access to this site, but there are many ways to get data from web, lots of M functions. Try one of these others: https://docs.microsoft.com/en-us/powerquery-m/web-page Or if you post in the Power Query forum you might get some of the gurus there to help out. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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