TsgcWebSocketClient › Proprietà › Authentication
Configura le credenziali e lo schema utilizzati per autenticare l'handshake WebSocket.
property Authentication: TsgcWSAuthenticationClient_Options read FAuthentication write SetAuthentication;
Enabled=False
Impostare Authentication.Enabled su True e scegliere uno dei quattro schemi: Basic (intestazione HTTP Basic), Token (intestazione bearer token, opzionalmente popolata da un componente OAuth2 allegato), Session (login HTTP che restituisce un id di sessione incluso nella GET di handshake) e URL (utente e password aggiunti alla GET di handshake). Assegnare User/Password o Token.AuthToken e abilitare esattamente uno dei quattro schemi.
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;