PDA

View Full Version : http authentication with a dataset


captin
03-10-2004, 11:59 AM
I am fairly new to laszlo and am impressed thus far.

Recently I have run into an issue while researching the feasability of integration.

When trying to connect to a cgi on a webserver that requires http basic authentication, the connection times out.

Here is a sample code snippet

--------
<dataset
name="test"
src="https://user:pass@server.com/myscript.cgi">
--------

The above is the functionality I am looking for.

I have also tried the following:

------------
<dataset
name="test"
src="https://server.com/myscript.cgi">

... and a little later ...

<button>go
<method event="onclick">
var d = canvas.datasets.test;
d.setHeader(
"Authorization",
"Basic KnownBase64UsernamePlusPassword"
);
d.setQueryString( ... stuff ... );
d.doRequest();
</method>
</button>

This second method also does not work. Does anyone have any suggestions for getting a simple datasource working with a server configured to use Basic HTTP Auth?

antun
03-10-2004, 01:12 PM
Basic HTTP authentication for data requests isn't supported at the moment, although I have filed a feature request for this.

In the meantime, I suppose you could write a server script that you made the request to from your Laszlo app, which would make the request to your XML data source (adding the user and password to the request), and pass that XML back.

-Antun

captin
03-10-2004, 01:48 PM
Thanks for the response. Is it true that the
setHeader(k,v) method of the dataset adds a valid HTTP header?

If so, then shouldn't the HTTP auth theoretically work since I am passing a known value manually? I don't care about prompting a user for a password (but will in the future).

fvandijk
05-05-2006, 04:20 AM
Originally posted by antun
Basic HTTP authentication for data requests isn't supported at the moment, although I have filed a feature request for this.

In the meantime, I suppose you could write a server script that you made the request to from your Laszlo app, which would make the request to your XML data source (adding the user and password to the request), and pass that XML back.

-Antun

Since this message was posted in 2004, has there been any improvements/additions to dataset to allow basic authentication for remote datasources?

I'm trying to build a small front-end for a FileMaker database (using fmxmlresult publishing) and would like to use FM's built-in security.