#1 2025-10-18 08:23:26

idigger
Member
Registered: 2022-11-05
Posts: 15

URI Authentication Failed after routing

Compile and execute the following program.

client.pas and server.pas

Run the server and client, and the output is as follows:

server side output

client side output

# client
--- no routed ---
test GET method
r: 200
resp: {"code": 0}

test POST method
r: 200
resp: {"code": 0}

--- routed ---
test GET method
r: 403
resp: {
"errorCode":403,
"errorText":"URI Authentication Failed: Invalid signature (0)"
}

test POST method
r: 403
resp: {
"errorCode":403,
"errorText":"URI Authentication Failed: Invalid signature (0)"
}

Last edited by idigger (2025-10-19 05:30:13)

Offline

#2 2025-10-18 20:49:25

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,247
Website

Re: URI Authentication Failed after routing

Please follow the forum rules and dont put code and logs direct in the forum threads.

Offline

#3 2025-10-18 20:58:29

idigger
Member
Registered: 2022-11-05
Posts: 15

Re: URI Authentication Failed after routing

Ok, sorry, I just saw the forum rules 2 and 7. The post has been edited.

Last edited by idigger (2025-10-19 05:39:44)

Offline

#4 2025-10-21 13:37:51

idigger
Member
Registered: 2022-11-05
Posts: 15

Re: URI Authentication Failed after routing

URI authentication is also not applicable to the following routes.

HttpServer.Route.Run([urmGet, urmPost], '/app/api', Server.domyapi);

URI authentication currently does not work with routing.
If you want to use URI authentication, you cannot use routing.

Last edited by idigger (2025-10-21 13:42:49)

Offline

#5 2025-10-21 14:03:22

idigger
Member
Registered: 2022-11-05
Posts: 15

Re: URI Authentication Failed after routing

I found that root can be set to the following form and still work without using routing.

Server := TMyServer.Create('myroot/v1');

server output

--- myapi ---
url: myapp/v1/myapi?q=abc&v=123&session_signature=000f36e000014ac1e3a96b48
method: mGET
Parameters: q=abc&v=123&session_signature=000f36e000014ac1e3a96b48
body:{"req": "hello"}

Last edited by idigger (2025-10-21 14:14:48)

Offline

Board footer

Powered by FluxBB