LabKey and Tableau A. Tyrell  2016-11-08 09:31
Status: Closed
 
Is there a version of the Javascript API, that allows you to authenticate and access data outside of LabKey.

"LabKey Server uses form-based authentication, by default, for all user-agents (ie browsers). However, it will correctly accept HTTP basic authentication headers if presented. I recommend using Basic Auth when programmatically accessing the server." I tried prepending the username and password to the hostname of the URL but I got the following message when I point the WebConnector tool from Tableau to a javascript export from a dataset with the credentials prepended...
"Redirect from ... to ... has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8888' is therefore not allowed access."
 
 
Jon (LabKey DevOps) responded:  2016-11-08 11:29
Hi Alicia,

We only have one Javascript API available.

Are you using this doc here to guide you in the auth process? http://www.fourproc.com/2011/08/25/accessing-a-labkey-server-with-python-node-js-or-wget.html

Or are you using another doc?

Also, can you provide an example of how you were prepending the username and password to the URL?

Are you attempting to try and access the LabKey Javascript API through some sort of Tableau interface?

Regards,

Jon
 
A. Tyrell responded:  2016-11-09 09:46
Hi Jon,

Yes I am familiar with the site that is where I got the verbiage in quotes.
I am trying to access the labkey data with a tableau web connector tool.

https://onlinehelp.tableau.com/current/api/wdc/en-us/help.htm

Using a web data connector, you can create and use a connection to almost any data that is accessible over HTTP. This can include internal web services, JSON data, XML data, REST APIs, and many other sources. Because you control how the data is fetched, you can even combine data from multiple sources.

I am working a workaround and will be back to post my findings shortly...

Thanks,

A. Tyrell