Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 14 total
Thread Serverrequest not sending password and/or username
Tue, Jun 20 2017 7:12 AMPermanent Link

Ronald

Hi,

I have EWB 2.06b2 and I ran into a problem with TServerrequest. I created a minimal EWBModule with this code:

Request.SendContent('password: '+Request.RequestPassword);

(of course there is more code)

If I test this in a EWB webapp with this:

srTest.UserName:='testusername';
srTest.Password:='testpassword';
srTest.Execute;

and I run the app, then I get the answer: 'password: '.

Why do not I see the password?

Greetings,
Ronald
Tue, Jun 20 2017 7:46 AMPermanent Link

Matthew Jones

Ronald wrote:

> Request.SendContent('password: '+Request.RequestPassword);

Isn't that setting the content, and not the password in the header?

--

Matthew Jones
Tue, Jun 20 2017 7:53 AMPermanent Link

Ronald

"Matthew Jones" wrote:

> Request.SendContent('password: '+Request.RequestPassword);

>Isn't that setting the content, and not the password in the header?


That is code from the the server sending the Password back to the client. I assume that I can read in the servermodule the password that I sent from my client. I also assume that the ewb client puts this password in the header before sending to the server. And then the servermodule gets the password from the header and puts it in  requestPassword".
Could be I assume too much...
Tue, Jun 20 2017 8:08 AMPermanent Link

Matthew Jones

Ronald wrote:

> That is code from the the server sending the Password back to the client. I assume that I can read in the servermodule the password that I sent from my client. I also assume that the ewb client puts this password in the header before sending to the server. And then the servermodule gets the password from the header and puts it in  requestPassword".
> Could be I assume too much...

Ah, right, I see now. What is the Chrome debugger showing? You should be able to see the header being sent. I'm not familiar with the web modules in EWB server, but does it have basic authentication turned on? If not, it may not process the header for it.

--

Matthew Jones
Tue, Jun 20 2017 8:22 AMPermanent Link

Ronald

"Matthew Jones" wrote:

<Ah, right, I see now. What is the Chrome debugger showing? You should be able to see the header being sent. I'm not familiar with the web modules in EWB server, but does it have basic authentication turned on? If not, it may not process the header for it.
>

No there is nothing in the headers too.
Tue, Jun 20 2017 8:31 AMPermanent Link

Matthew Jones

Ronald wrote:

> "Matthew Jones" wrote:
>
> <Ah, right, I see now. What is the Chrome debugger showing? You should be able to see the header being sent. I'm not familiar with the web modules in EWB server, but does it have basic authentication turned on? If not, it may not process the header for it.
> >
>
> No there is nothing in the headers too.

I'd certainly expect there to be the data in the headers. That's where I'd look first.

That said, a search for requests and passwords brings up the PDF demo, which has this:

procedure TMainForm.MainFormCreate(Sender: TObject);
begin
 with PDFServerRequest do
    begin
    { Set the authentication information as URL parameters }
    Params.Values['user']:='Demo';
    Params.Values['password']:='Password';
    Params.Values['method']:='list';
    URL:='modules/pdfmodule';
    Execute;
    end;
end;

But I'd still want to work out why your code isn't getting the headers it should. Trace it in Chrome.

--

Matthew Jones
Tue, Jun 20 2017 8:40 AMPermanent Link

Ronald

"Matthew Jones" wrote:

<I'd certainly expect there to be the data in the headers. That's where I'd look first.

That said, a search for requests and passwords brings up the PDF demo, which has this:
>

Oops, sorry I was not precise enough, the usual headers are there, but not the "passwordheader" en "usernameheader" are not.
Tue, Jun 20 2017 9:09 AMPermanent Link

Walter Matte

Tactical Business Corporation


ServerRequest.Params.Add('Password=XXXXX');

Walter
Tue, Jun 20 2017 9:35 AMPermanent Link

Matthew Jones

Walter Matte wrote:

>
> ServerRequest.Params.Add('Password=XXXXX');

That will add it as a parameter though, not in the header. I guess the key here is to find the documentation for EWB Server modules and how the authentication should be passed in.

https://www.elevatesoft.com/manual?action=viewtopic&id=ewb2mod&product=rsdelphiwin32&version=XE2&topic=Handling_Requests

Custom HTTP Authentication Headers

The custom HTTP authentication headers must be sent to the web server as follows:

X-EWBUser: <UserName>
X-EWBPassword: <Password>

--

Matthew Jones
Tue, Jun 20 2017 9:49 AMPermanent Link

Ronald

"Matthew Jones" wrote:

<The custom HTTP authentication headers must be sent to the web server as follows:

X-EWBUser: <UserName>
X-EWBPassword: <Password>>

Indeed that are the haeders, this works fine if I use the Database component. You can set the username en password properties in de the database component. These are then sent as headers with the database call to the server. Actually you can choose how they are sent: as parameters or as headers.

Ronald
Page 1 of 2Next Page
Jump to Page:  1 2
Image