TsgcWSPClient_STOMP_ActiveMQ › Properties › Authentication
Sends login and passcode headers in the STOMP CONNECT frame to authenticate the client against the ActiveMQ broker.
property Authentication: TsgcWSSTOMPAuthentication_Options read FAuthentication write SetAuthentication;
Enabled=False, UserName='', Password=''
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. ActiveMQ validates the pair against its JAAS login module (default SimpleAuthenticationPlugin or the property/LDAP realms); leave Enabled at False only if the broker is configured with anonymous access.
STOMP := TsgcWSPClient_STOMP_ActiveMQ.Create(nil);
STOMP.Client := WSClient;
STOMP.Authentication.Enabled := True;
STOMP.Authentication.UserName := 'admin';
STOMP.Authentication.Password := 'admin';
WSClient.Active := True;