dotnet / MQTTnet

MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
MIT License
4.5k stars 1.07k forks source link

Error while authenticating. Extended authentication handler is not yet supported, with Azure Event Grid MQTT Broker #2095

Open pre-subham opened 4 weeks ago

pre-subham commented 4 weeks ago

Verification

Describe the bug

We're facing this error: Error while authenticating. Extended authentication handler is not yet supported. with the Latest MQTT net release and Azure Event Grid MQTT Broker. We have already tried the solution mentioned to recreate the certificate/user for the Broker, but this issue is frequent on two days basis on One particular Broker out of 3 setups. Everything is consistent across deployment but the issue is faced with one broker only.

Which component is your bug related to?

To Reproduce

Steps to reproduce the behavior:

  1. Using this version of MQTTnet '...'. 4.2.1.781, 4.3.7.1207
  2. Run this code '....'.
    mqttClientOptions = new MqttClientOptionsBuilder()
                    .WithClientId(MqttPublisherConstant.userId)
                    .WithTcpServer(MqttPublisherConstant.connectHost, MqttPublisherConstant.port)
                    .WithTls(new MqttClientOptionsBuilderTlsParameters
                    {
                        UseTls = true,
                        Certificates = certs
                    })
                    .WithCredentials(MqttPublisherConstant.userName)

Expected behavior

Should connect without any issues.

Screenshots

Image

rido-min commented 4 weeks ago

ExtendedAuthentication is supported with MQTT5, and usually used with OAUTH tokens, not sure what's the use case to use ExtendedAuth with certificates.

There is a sample to connect to EventGrid with JWT tokens

note how ExtendedAuth is used in the WithJWT extension method

pre-consultant commented 3 weeks ago

What is the change required here for the use of certificate @rido-min. We have been running same for past 1 year, this error started coming now. We have not mentioned protocol, hence it's using default which should be v3.1.

chkr1011 commented 3 weeks ago

@pre-subham It seems that this feature is broken (regardless of certificates or other variant). There is a handler for that but not used when connecting. I will add it and let you know when a test version is available.

pre-consultant commented 3 weeks ago

@chkr1011 What can we do in the meantime, the broker is disconnecting every day

pre-consultant commented 2 weeks ago

Hi @chkr1011 , do you have any version where this feature will work or any step for keeping it from disconnecting until new version is available?