TsgcWSPClient_AMQP1 › Events › OnAMQPSASLAuthentication
Fires with the SASL outcome returned by the peer during the AMQP 1.0 SASL layer, letting the handler decide whether to swallow a failure.
property OnAMQPSASLAuthentication: TsgcAMQP1SASLAuthenticationEvent;
// TsgcAMQP1SASLAuthenticationEvent = procedure(Sender: TObject; aCode: TsgcAMQP1SaslCode; const aDescription: string; var Handled: Boolean) of object
—
Raised when the peer returns a sasl-outcome frame during the SASL sub-protocol that precedes the AMQP 1.0 Open handshake. aCode is the SASL outcome code (ok=0, auth=1 authentication failed, sys=2 system error, sys-perm=3 permanent system error, sys-temp=4 transient) and aDescription is the broker's text. Set Handled := True to suppress the default behaviour (which is to abort the connection) when the application wants to ignore a particular code or retry with different credentials. For Azure Service Bus with CBS the handshake is normally ANONYMOUS, and the real authorisation happens via PutCBSToken after Open.
procedure TForm1.oAMQP1AMQPSASLAuthentication(Sender: TObject;
aCode: TsgcAMQP1SaslCode; const aDescription: string; var Handled: Boolean);
begin
DoLog(Format('#AMQP1 SASL: code=%d %s', [Ord(aCode), aDescription]));
end;