#1 2012-10-18 14:25:17

sytis
Member
From: Milano
Registered: 2012-10-16
Posts: 11

04 - HTTP Client-Server Error 403 Forbidden

Hi!
I'm new to Delphi and mORMot...

I'm trying samples and everything seems to work as expected.

After some data insert from Project4Client.exe I try to GET some data from RESTclient/browser

10.0.0.100:8080/root
10.0.0.100:8080/root/SampleRecord
10.0.0.100:8080/root/SampleRecord/1

But I get this error instead of JSON data:

{
   "ErrorCode":"403",
   "ErrorText": "Forbidden"
}

There is some authentication to setup in the browser? I'm doing something wrong?

I'm using Delphi7/RAD Studio XE2 with the same result.

Thanks!
Mauro

Offline

#2 2012-10-18 15:45:34

sytis
Member
From: Milano
Registered: 2012-10-16
Posts: 11

Re: 04 - HTTP Client-Server Error 403 Forbidden

OK!
as for Version 1.16
-- added authentication to the remote process

In the client I see this login/pwd: User / synopse

but from RESTclient using Basic Authentication I'm facing the same error...

How can I disable aHandleUserAuthentication in the server just to test the connection?

Offline

#3 2012-10-19 08:20:53

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: 04 - HTTP Client-Server Error 403 Forbidden

according to documentation, which you can easy found here: http://synopse.info/fossil/wiki?name=Do … umentation (direct link http://synopse.info/files/pdf/Synopse%2 … 201.17.pdf ) mORMot don't use HTTP auth at all. Please, read documentation or see the comments in source codes (in interface part of SQLite3Commons TSQLRestServer.Create). In sample project you are talking about you can easy turn off auth by change this line of code in unit2.pas
DB := TSQLRestServerDB.Create(Model,ChangeFileExt(paramstr(0),'.db3'), FALSE {aHandleUserAuthentication});

Offline

#4 2012-10-22 05:33:22

sytis
Member
From: Milano
Registered: 2012-10-16
Posts: 11

Re: 04 - HTTP Client-Server Error 403 Forbidden

Thanks it worked!
After reading “1.4.4.1.3. Authentication” in http://synopse.info/files/pdf/Synopse%2 … 201.17.pdf mORMot REST authentication is more clear to me now!

I think that the current “1.4.3.1.2.3. REST and JSON” example in the same doc it’s not correct because it doesn’t mention authentication at all.

Mauro

Offline

#5 2012-10-22 05:56:05

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: 04 - HTTP Client-Server Error 403 Forbidden

You are right: I've just fixed documentation about "REST and JSON".
In order to have it working as written, authentication shall be disabled first.

See http://synopse.info/fossil/info/3773230b33

Thanks for the report.

Offline

Board footer

Powered by FluxBB