TsgcWSPClient_AMQPEvents › OnAMQPAuthentication

OnAMQPAuthentication Event

Lets the application choose the SASL mechanism and supply the credentials during the AMQP login.

Syntax

property OnAMQPAuthentication: TsgcAMQPAuthenticationEvent;
// TsgcAMQPAuthenticationEvent = procedure(Sender: TObject; aMechanisms: TsgcAMQPAuthentications; var Mechanism: TsgcAMQPAuthentication; var User, Password: string) of object

Default Value

Remarks

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.

Example

procedure TForm1.oAMQPAMQPAuthentication(Sender: TObject;
  aMechanisms: TsgcAMQPAuthentications; var Mechanism: TsgcAMQPAuthentication;
  var User, Password: string);
begin
  Mechanism := amqpAuthPLAIN;
  User := 'guest';
  Password := 'guest';
end;

Back to Events