Can OAuth authorization be used while using amqp10 package for amqps protocol to connect solace brok

prashantk2000
Mon, 02 Jan 2023 08:41:20 +0000
Solace Event Broker

In my nodejs based application I am trying to connect solace broker using amqps protocol and package I am using is **amqp10 ** however I am unable to connect it. As per the doc I am creating the uri as ‘amqps://:@broker-host:5671?amqp.saslMechanisms=XOAUTH2’.
But this is not working. Any suggestions? Please share if any sample is available. Is there any alternative?
let uri = “amqps://admin:” + token.access_token + “@svc-solace-broker:5671?amqp.saslMechanisms=XOAUTH2”;
amqpClient.connect(uri).then(() => {
// create a sender to the queue
return amqpClient.createSender(self.queueName);
}).then((amqpSender) => {
self.log(Sending message '${message}'...);
return amqpSender.send(message).then(() => {
self.log(‘Message sent successfully.’);
self.exit();
}, (error) => {
self.error(error);
});
});

8 posts - 1 participant