Hello all.
I am hoping somebody has enough experience or insight to tell me what I am doing wrong.
I have a simple Delphi DataSnap REST server and I am trying to validate UserName and Password.
So in the B4A code I am doing this:
********
Sub btnlogin_click
Dim h1 As HttpJob
' URL="http://" & edtName.Text & ":" & edtPassword.Text & "@" & edtServerIP.Text & ":" & edtServerPort.Text & "/datasnap/rest/DSAdmin/GetPlatformName"
URL="http://"edtServerIP.Text & ":" & edtServerPort.Text & "/datasnap/rest/DSAdmin/GetPlatformName"
h1.Initialize(URL,Me)
h1.Username=edtName.Text
h1.Password=edtPassword.Text
h1.Download(URL)
End Sub
*******
Inside the Delphi server there is an event that fires (correctly) on the first attempt a client makes to connect. It looks like this:
********
procedure TServerContainer1.DSAuthenticationManager1UserAuthenticate(
Sender: TObject; const Protocol, Context, User, Password: string;
var valid: Boolean; UserRoles: TStrings);
begin
{ TODO : Validate the client user and password.
If role-based authorization is needed, add role names to the UserRoles parameter }
valid := True;
end;
********
The job starts from B4A and completes successfully; JobDone fires with status of success.
But when the Delphi event fires, the User and Password parameters are always blank.
Does anybody have a clue what might be happening?
Thanks,
Mark
I am hoping somebody has enough experience or insight to tell me what I am doing wrong.
I have a simple Delphi DataSnap REST server and I am trying to validate UserName and Password.
So in the B4A code I am doing this:
********
Sub btnlogin_click
Dim h1 As HttpJob
' URL="http://" & edtName.Text & ":" & edtPassword.Text & "@" & edtServerIP.Text & ":" & edtServerPort.Text & "/datasnap/rest/DSAdmin/GetPlatformName"
URL="http://"edtServerIP.Text & ":" & edtServerPort.Text & "/datasnap/rest/DSAdmin/GetPlatformName"
h1.Initialize(URL,Me)
h1.Username=edtName.Text
h1.Password=edtPassword.Text
h1.Download(URL)
End Sub
*******
Inside the Delphi server there is an event that fires (correctly) on the first attempt a client makes to connect. It looks like this:
********
procedure TServerContainer1.DSAuthenticationManager1UserAuthenticate(
Sender: TObject; const Protocol, Context, User, Password: string;
var valid: Boolean; UserRoles: TStrings);
begin
{ TODO : Validate the client user and password.
If role-based authorization is needed, add role names to the UserRoles parameter }
valid := True;
end;
********
The job starts from B4A and completes successfully; JobDone fires with status of success.
But when the Delphi event fires, the User and Password parameters are always blank.
Does anybody have a clue what might be happening?
Thanks,
Mark
Last edited: