TsgcWSPClient_AMQP › Events › OnAMQPAuthentication
Lets the application choose the SASL mechanism and supply the credentials during the AMQP login.
property OnAMQPAuthentication: TsgcAMQPAuthenticationEvent;
// TsgcAMQPAuthenticationEvent = procedure(Sender: TObject; aMechanisms: TsgcAMQPAuthentications; var Mechanism: TsgcAMQPAuthentication; var User, Password: string) of object
—
Raised during the connection.start/connection.start-ok handshake. aMechanisms contains the SASL mechanisms advertised by the server (for example PLAIN, AMQPLAIN, EXTERNAL). Set Mechanism to the one you want to use and fill User/Password with the credentials to submit. If this event is not handled, the client falls back to the values configured in Authentication.
procedure TForm1.oAMQPAMQPAuthentication(Sender: TObject;
aMechanisms: TsgcAMQPAuthentications; var Mechanism: TsgcAMQPAuthentication;
var User, Password: string);
begin
Mechanism := amqpAuthPLAIN;
User := 'guest';
Password := 'guest';
end;