problem with Qpid Proton C++ connecting to Broker(Apache ActiveMQ Artemis). using SASL SCRAM-SHA-256 as authentication mechanism

20 views Asked by At

I am using the qpid proton c++ library to connect to Broker(Apache ActiveMQ Artemis). The authentication mechanism must be SALS SCRAM_SHA-256.

i have installed cyrus library version 2.1.27 which should support SCRAM-SHA-256

i tried to configure Qpid proton client to use this mechanism via the following methods:

        std::string MECHANISM = "SCRAM-SHA-256";
        ConnectionOptions.sasl_allowed_mechs(MECHANISM);
        ConnectionOptions.sasl_allow_insecure_mechs(true);
        ConnectionOptions.sasl_enabled(true);
        ConnectionOptions.user("guest");
        ConnectionOptions.password("guest");

broker.xml file for artmise broker looks like that:

tcp://0.0.0.0:7014?saslMechanisms=SCRAM-SHA-256,tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpMinLargeMessageSize=102400;amqpDuplicateDetection=true;amqpUsername=guest;amqpPassword=guest

when i try to connect the get the following message from client side: amqp:unauthorized-access: Authentication failed [mech=SCRAM-SHA-256]

and from broker side: WARN [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure to /127.0.0.1:47668 has been detected: null [code=REMOTE_DISCONNECT]

when i change the mechanism to PLAIN in both side broker and client the client can connect to the broker without any problem

i tried to connect to broker using SASL SCRAM-SHA-256 but it didnot work out

0

There are 0 answers