|Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder Web Server and Modules » View Thread|
|Messages 1 to 3 of 3 total|
|How to transfer request.userName and request.password to module|
|Fri, Dec 21 2018 8:30 AM||Permanent Link|
Iztok Lajovic (1)
I cannot get proper request.userName and request.password in EWB module. Every attempt to authenticate the user fails with error 'Authentication failed'.
a) In calling EWB program I have following code:
with serverRequest do begin
b) In 'ewbMyModule' I have in the function DatabaseAdapterAuthenticateUser following statement:
Authenticated := AnsiSameText(RequestUserName,'Administrator') and
c) Later, in function EWBModuleExecute I prepare the message to get information about requestUser and requestPassword that were passed to EWB module:
Request.SendContent(Request.RequestUser + ' ' + request.RequestPassword);
d) In calling program in function ServerRequestComplete I get the following response in responseContent.text:
- if I put the code c) in the program with no statement statement 'if AuthenticateUser(Request) ...' then I get values 'Administrator EDBDefault' meaning that both fields requestUser and requestPassword have appropriate values
- if I include statement 'if AuthenticateUser(Request) ...' then I get error 'Authentication failed'.
Question is: where and how can I pass the values for RequestUserName and RequestPassword required in in code b) from corresponding values request.requestUser and resquest.request.password to pass user authentication without error?
|Sun, Dec 23 2018 6:18 AM||Permanent Link|
Iztok Lajovic (1)
>Question is: where and how can I pass the values for RequestUserName and RequestPassword required in in >code b) from corresponding values request.requestUser and resquest.request.password to pass user >authentication without error?
I found workaround for this problem: if I put following explicit code for the session (although both attributes are defined in session parameters):
sekcija.LoginUser := Request.RequestUser;
sekcija.LoginPassword := request.RequestPassword;
then I can pass failing connection of the session.
I found next obstacle in the same way: although the attribute 'session.localConfigPath' is defined in sessions' parameters I have to put following additional code:
session.LocalConfigPath := 'c:\..\EDB';
If I don't repeat this information then I get the error like 'session.LocalConfigPath is empty'
What I have to do to avoid this unexpected behavior?
|Mon, Dec 31 2018 11:22 AM||Permanent Link|
Tim Young [Elevate Software]
Elevate Software, Inc.
<< I found workaround for this problem: if I put following explicit code for the session (although both attributes are defined in session parameters): >>
How are you setting up the ElevateDB engine parameters ? If you're trying to access a database using a local session, then there are certain ElevateDB engine parameters that need to be set up *once* in the web server module in the initialization section in order to have things work correctly with multiple threads, etc.
The databasemodule.dpr example web server module that is included with EWB shows how to do this for ElevateDB (at the bottom of the page):
You probably don't want to use an in-memory configuration, but the general idea is the same.