TsgcWebSocketClient › Właściwości › Authentication
Konfiguruje poświadczenia i schemat używany do uwierzytelniania uzgodnienia WebSocket.
property Authentication: TsgcWSAuthenticationClient_Options read FAuthentication write SetAuthentication;
Enabled=False
Należy ustawić Authentication.Enabled na True i wybrać jeden z czterech schematów: Basic (nagłówek HTTP Basic), Token (nagłówek tokenu Bearer, opcjonalnie wypełniany przez dołączony komponent OAuth2), Session (logowanie HTTP zwracające identyfikator sesji zawarty w żądaniu GET uzgadniania) oraz URL (nazwa użytkownika i hasło dołączane do żądania GET uzgadniania). Należy przypisać User/Password lub Token.AuthToken i włączyć dokładnie jeden z czterech schematów.
oClient := TsgcWebSocketClient.Create(nil);
oClient.Authentication.Enabled := true;
oClient.Authentication.Basic.Enabled := true;
oClient.Authentication.User := 'your user';
oClient.Authentication.Password := 'your password';
oClient.Active := True;