MQTT Samples - Authentication

You can do authentication in 2 ways. You can use the VerifyConnection method on the MqttBridge and check the Username and Password from the Mqtt client. However, you can also use the XSocketsAuthenticationPipeline module to create a IPrincipal for the connection. Once you have the principal you can use that in all the methods in the MqttBridge to (for example) get role based authentication.