Unable to connect with solace using amqps protocols with OAuth

cpjani
cpjani Member Posts: 5

    String solaceHost = "amqps://<host>:<port>?amqp.saslMechanisms=XOAUTH2";

    String solaceUsername = Username

    String solacePassword = access_token


Error : Authentication has not completed yet.

Please find attached logs


Tagged:

Comments

  • Karl Ossoinig
    Karl Ossoinig Member Posts: 10

    Hello @cpjani

    The format of the AMQP connection URL will be dependent on who's AMPQ API provider you are using to connect to the Solace broker. Can you please tell me a little more about your environment?

  • mstobo
    mstobo Member, Employee Posts: 22 Solace Employee

    Hi @cpjani

    Looking at your logs I see you have the SASL mechanism set as OAUTH2...

    "us-east-1.amazonaws.com:5671?amqp.saslMechanisms=OAUTH2"

    You need to set it as XOAUTH2 per the docs.


    Section 5.3.3.1: SASL Mechanisms

    1. Applicable specification text:

    Entire section.

    Solace implementation:

    An event broker supports SASL mechanisms of:

    • ANONYMOUS, when the Message VPN has no authentication enabled;
    • PLAIN, when the Message VPN has authentication enabled;
    • EXTERNAL, when the AMQP connection is over TLS and the Message VPN has client-certificate authentication enabled.
    • XOAUTH2, when the Message VPN has OAuth authentication enabled.


  • cpjani
    cpjani Member Posts: 5

    Hi @mstobo,

    We have tried with XOAUTH2 but getting same error as Authentication has not completed yet.

    Please find attached logs. we are using org.apache.qpid.jms.JmsConnectionFactory lib.


  • Karl Ossoinig
    Karl Ossoinig Member Posts: 10
    edited February 2023 #5

    Hello @cpjani - Looking at each of the logs you provided just prior to the exceptions stack trace shows this:

    It appears that your test driven development tooling is attempting to run a queue consumer test connecting to the broker, but the authentication step has not completed. In both attempts, the log shows an unknown SASL mechanism error.

    To help debug this further, what OAUTH2 provider are you configuring?

    QPID appears to support these providers: https://qpid.apache.org/releases/qpid-broker-j-8.0.0/book/Java-Broker-Security.html