TsgcWebSocketClient › Propriedades › Authentication
Configura as credenciais e o esquema usados para autenticar o handshake WebSocket.
property Authentication: TsgcWSAuthenticationClient_Options read FAuthentication write SetAuthentication;
Enabled=False
Defina Authentication.Enabled como True e escolha um de quatro esquemes: Basic (cabeçalho HTTP Basic), Token (cabeçalho bearer token, opcionalmente preenchido por um componente OAuth2 anexado), Session (login HTTP que retorna um session id incluído no GET de handshake) e URL (usuário e senha anexados ao GET de handshake). Atribua User/Password ou Token.AuthToken e habilite exatamente um dos quatro esquemes.
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;