Phoste
Phoste

Reputation: 1209

How can I connect to WSO2 Message Broker with an MQTT Client?

I have installed WSO2 IOT Server and I am trying to understand it... My principal objective is to make some IOT Device send data through MQTT. But I can't even connect to MQTT with Mqtt.fx... I am using tcp://localhost:1886 as the broker URL address even though in the broker.xml config file it's said that the port is 1883 - It doesn't work either. I uses admin as the login and password, but I get an error:

[2017-03-31 10:40:07,861] [IoT-Broker]  INFO {org.dna.mqtt.moquette.messaging.sp
i.impl.ProtocolProcessor} -  Lost connection with client 5354d06fb5694b5cb65f07c
f3c62fa23
[2017-03-31 10:40:07,863] [IoT-Broker]  WARN {org.dna.mqtt.moquette.messaging.sp
i.impl.ProtocolProcessor} -  MQTTAuthorizationSubject for client ID 5354d06fb569
4b5cb65f07cf3c62fa23 is not removed since the entry does not exist

What am I doing wrong ?

Second issues, I can't access to WSO2 Message Broker management... I get an Error 403 Forbidden when I use https://localhost:9446/carbon. And I don't know how to access the WSO2 Message Broker when I am on the WSO2 IOT Server management page. (https://localhost:9443/carbon which works)

Upvotes: 2

Views: 451

Answers (1)

exterminator
exterminator

Reputation: 260

MQTT broker in wso2 IoT Server has a pluggable authentication and authorization, by default it comes with an OAuth based authentication, where it uses an empty password and uses an OAuth token for the username. You can generate a token by following the docs in https://docs.wso2.com/display/AM200/Password+Grant.

Implementation of this extension is explained in [1] and [2]. [1] https://medium.com/@ayyoobhamza/authentication-and-authorization-extension-for-mqtt-wso2-message-broker-2495fb2fa56e [2] https://medium.com/@ayyoobhamza/oauth-authentication-and-authorization-with-mqtt-for-iot-devices-a42019187a05

Upvotes: 1

Related Questions