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.47k 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 1 day ago

pre-subham commented 1 day 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 1 day 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 5 hours 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.