Forum Discussion

JulianS's avatar
JulianS
Icon for Advocate II rankAdvocate II
9 years ago

Issue when connecting to Web.Contents in service

Hi,

 

i get my data by requesting premade CSV documents from our web application in the Desktop app using the following connection:

= Web.Contents("https://web app service url",[Headers=[#"apiKey"="some api key"],Timeout=#duration(0, 0, 5, 0)])

This works as the desktop request is processing the specified headers in the request and therefore allowing this as an auth method.

However when i export the datasets to the service no connection is possible anymore and i can't schedule any refresh.

There is not even an option to set any connection headers and i have to assume the setting from the desktop app is not transferred.

 

Question: Is this planned to be implemented later on or did i miss some other way to use it?

 

Since the service currently allows basic http auth, we implemented this as a work around for the time being.

However also with this method i can't get it to work sadly.

Problem here starts with the desktop application already:

1. Auth request is sent:

Request:
GET app_url HTTP/1.1
Accept: */*
User-Agent: Microsoft.Data.Mashup (https://go.microsoft.com/fwlink/?LinkID=304225)
Authorization: Basic username:password
Accept-Encoding: gzip, deflate
Host: app_url
Connection: Keep-Alive

2. Response from server 302 - redirects to the service url again

3. Desktop app requests the service url, but without using session cockie therefore receiving forbidden.

Do we need to put the CSV directly in the response without redirect in order for this to work with the basic auth?

Anyone using a similar approach maybe and could share their experience?

 

cheers!

 

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi JulianS,

     

    Did you use custom functions in query editor? If this is a case, currently custom function only works on desktop side, it not works on service side.

     

    Regards,

    Xiaoxin Sheng

    • JulianS's avatar
      JulianS
      Icon for Advocate II rankAdvocate II

      Hi, no custom functions were used.

      It's working with the basic http authentification now in the service, since we implemented that as a workaround.

      However i'd still like to know if we can use any http header based authentification in the service in the near future.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi JulianS,

         

        Web.Content support this parameter, but you should ensure the service which you requested if it support "authentication" parameter.

         

        Regards,

        Xiaoxin Sheng