Thread View: pl.comp.lang.delphi
1 messages
1 total messages
Started by konsul675@gmail.
Wed, 20 May 2020 12:59
mormot i autentykacja
Author: konsul675@gmail.
Date: Wed, 20 May 2020 12:59
Date: Wed, 20 May 2020 12:59
50 lines
1575 bytes
1575 bytes
Potrzebuję waszej pomocy. Delphi 10.3.3 Community mormot Strona serwera procedure Tmainform.FormShow(Sender: TObject); var Ctxt: TSQLRestServerURIContext; aCall: TSQLRestURIParams; begin FDPhysPgDriverLink1:= TFDPhysPgDriverLink.Create(nil); dataDir:=ExtractFileDir(GetModuleName(0))+'\data\'; Model:= TSQLModel.Create ([TSQLAuthGroup,TSQLAuthUser,TLekarz]); VirtualTableExternalRegister (Model, [TLekarz],PropsFireDac,[]); ServerDB:= TMethodServer.Create (Model, 'demed',false); ServerDB.CreateMissingTables(); ServerDB.ServiceRegister (TServiceRemoteSQL, [TypeInfo (IRemoteSQL)],sicClientDriven).SetOptions([],[optExecInMainThread,optFreeInMainThread]); serwer := TSQLHttpServer.Create ('888', [ServerDB]); serwer.AccessControlAllowOrigin := '*'; // allow cross-site AJAX queries end; Client fModel := TSQLModel.Create([TLekarz],ROOT_NAME); fClient := TSQLHttpClientWinHTTP.Create('localhost',PORT_NAME,fModel); if not fClient.ServerTimeStampSynchronize then begin ShowLastClientError(fClient,'Please run Project16ServerHttp.exe'); Close; exit; end; fClient.ServiceRegisterClientDriven(TypeInfo(IRemoteSQL),fService); To działa w przeglądarce i w kliencie ale ... Co trzeba zrobić aby dodać autoryzację? Do serwera dodaję ServerDB.AuthenticationRegister(TSQLRestServerAuthenticationHttpBasic); to włącza autoryzacje w przeglądarce ale dostaję cały czas Authentication Failed: Unknown user (2) Jak to zrobić prawidłowo?
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads