Icon View Thread

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

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ronald,

<< 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... >>

Yes, that is the case.

You're not going to see any password header, etc. on the server side unless you *specifically* send such a header.  Only the database API handles this automatically via the TDatabase component.  Any other usage of the TServerRequest component requires that you manually populate such information.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Jun 20 2017 1:09 PMPermanent Link

Ronald

Tim Young [Elevate Software] wrote:


<<You're not going to see any password header, etc. on the server side unless you *specifically* send such a header.  Only the database API handles this automatically via the TDatabase component.  Any other usage of the TServerRequest component requires that you manually populate such information.>>

Ok, thanks, but why has TServerRequest the properties UserName and Password then?

Ronald
Tue, Jun 20 2017 1:19 PMPermanent Link

Ronald

Did a quick test and yes! If you send the headers in the TServerrequest like this:

srTest.RequestHeaders.Clear;
srTest.RequestHeaders.Add('X-EWBUser:testingusername');
srTest.RequestHeaders.Add('X-EWBPassword:testingpassword');

On the serverside the username and password can be found in:

Request.RequestPassword and Request.RequestUser

One question remains: why has TServerRequest the properties UserName and Password?

Ronald
Tue, Jun 20 2017 2:05 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ronald,

<< One question remains: why has TServerRequest the properties UserName and Password?  >>

They're for use with basic HTTP authentication:

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open

EWB doesn't use this with the database API, primarily because it isn't secure and using a secure connection (https) for database access is much more advisable.

Tim Young
Elevate Software
www.elevatesoft.com
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image