TsgcWSPClient_STOMP_RabbitMQProperties › Authentication

Authentication Property

Sends login and passcode headers in the STOMP CONNECT frame to authenticate the client against the RabbitMQ Web-STOMP plugin.

Syntax

property Authentication: TsgcWSSTOMPAuthentication_Options read FAuthentication write SetAuthentication;

Default Value

Enabled=False, UserName='', Password=''

Remarks

Authentication is disabled by default. Set Authentication.Enabled to True and assign UserName and Password to include the STOMP login and passcode headers in the CONNECT (or STOMP) frame sent when the transport comes up. The credentials are carried at the STOMP layer and are independent from the underlying WebSocket or raw-TCP transport: when Client.Active is set to True the client opens the WebSocket handshake via the attached Client (or raw TCP via Broker) and then emits CONNECT with the credentials together with the accept-version, host and heart-beat headers. RabbitMQ authenticates against its internal user database — the built-in guest/guest account is restricted to localhost by default, so production deployments should use a dedicated user with permissions on the target vhost. For anonymous setups leave Enabled at False.

Example


oRabbit := TsgcWSPClient_STOMP_RabbitMQ.Create(nil);
oRabbit.Client := WSClient;
oRabbit.Authentication.Enabled := True;
oRabbit.Authentication.UserName := 'guest';
oRabbit.Authentication.Password := 'guest';
WSClient.Active := True;

Back to Properties