TsgcWebSocketClientPropriedades › Authentication

Authentication Property

Configura as credenciais e o esquema usados para autenticar o handshake WebSocket.

Sintaxe

property Authentication: TsgcWSAuthenticationClient_Options read FAuthentication write SetAuthentication;

Valor Padrão

Enabled=False

Observações

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.

Exemplo


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;

Voltar para Propriedades