Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 2 of 2 total |
HTTP Post Password and Username |
Fri, Mar 16 2018 2:08 PM | Permanent Link |
KimHJ Comca Systems, Inc | When I create a module in EWB I get :
if AuthenticateUser(Request) then begin case Request.RequestMethod of rmGet: rmHead: rmPost: end; And if I add OnAuthenticateUser I get: procedure TEWBModule1.EWBModuleAuthenticateUser(const RequestUserName, RequestPassword: string; var Authenticated: Boolean); begin if RequestUserName = 'myname' then begin if RequestPassword = 'mypassword' then Authenticated := True; end else Authenticated := False; end; The OnAuthenticateUser works fine with GET but not with POST. PhoneReq:= TServerRequest.Create(nil); with PhoneReq do begin Try Method:=rmPost; URL:='/modules/mymodule'; RequestHeaders.Clear; RequestHeaders.Values['Content-Type']:='text/plain'; RequestContent.Clear; username:='myname'; password:='mypassword'; RequestContent.Values['storeid']:=CSStoreId; RequestContent.Values['phone']:=Phone; OnComplete := CheckForPhoneComplete; try Execute; except end; finally Free; end; end; PhoneReq:= TServerRequest.Create(nil); with PhoneReq do begin Try Method:=rmGet; URL:='/modules/mymodule'; RequestHeaders.Clear; RequestHeaders.Values['Content-Type']:='text/plain'; RequestContent.Clear; RequestContent.Values['username']:='myname'; RequestContent.Values['password']:='mypassword'; RequestContent.Values['storeid']:=CSStoreId; RequestContent.Values['phone']:=Phone; OnComplete := CheckForPhoneComplete; try Execute; except end; finally Free; end; end What do I do wrong? Thanks, Kim |
Fri, Mar 16 2018 8:08 PM | Permanent Link |
KimHJ Comca Systems, Inc | I found it.
I have to use the X-EWBUser and the X-EWBPassword in the RequestHeader. Kim |
This web page was last updated on Thursday, October 10, 2024 at 02:11 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |