You are not logged in.
Following the example in:
mORMot\SQLite3\Samples\ThirdPartyDemos\EMartin\TSynRestDataset
I modified the mORMot\SQLite3\Samples\04 - HTTP Client-Server example to contain a TSynRestDataset that should be able to connect to the SampleModel data as such:
Model := CreateSampleModel; // from SampleData unit
ds := TSynRestDataset.Create(Self);
ds.DataSet.SQLModel := Model;
ds.CommandText := 'http://localhost:8080/root/SampleRecord?select=Time,Name,Question&sort=ID';
ds.Open;
Upon running the ds.Open; I get :
First chance exception at $7C812FD3. Exception class ESynException with message 'Error
Authentication Failed: Invalid signature (0)
from
http://localhost:8080/root/SampleRecord?select=Time,Name,Question&sort=ID'. Process Project04Client.exe (103652)
What might I be missing? I know the server is running, because the I didn't remove the Project04Client controls, and they still work even after the Exception.
Offline
The exception text may help: the signature is invalid.
I guess you are accessing a Server with authentication enabled from a client with no authentication.
The request is therefore rejected.
Online
Arnaud,
So the question is, how do I authenticate?
Project04Client.dpr authenticates like this:
TSQLHttpClient(Form1.Database).SetUser('User','synopse');
I suspect that TSynRestSQLDataSet.OnGetURISignature needs to be implemented, but there's no example in the documentation on how to implement it.
I've seen that "&session_signature=..." is added, but I can't find a method that generates the signature.
Offline