MQTT Connection Refused: not authorised

I spent a lot of time fighting these errors when trying to connect via MQTT:
Connection Refused: not authorised.
client disconnected not authorised

The instructions on the Home Assistant Add-on: Mosquitto broker documentation tab state:

Create a new user for MQTT via your Home Assistant’s frontend Settings → People → Users , (i.e. not on Mosquitto’s Configuration tab). Notes:
This name cannot be homeassistant or addons, those are reserved usernames.

I could not get it to work as documented. Instead, I had to create a “People” account, not a “Users” account… ie. Settings → People → People

On top of that, the documentation for People (under the link “Learn more about people” talks about these kinds of accounts being used for GPS trackers. It makes no mention of MQTT.

Did I completely mess up, or is the documentation wildly inaccurate? Plus, why would it matter? What’s the difference between a People and a User?

2 Likes

Further down in the documentation it mentions having to manually create and edit some configuration files:
/share/mosquitto/acl.conf
/share/mosquitto/accesscontrollist

And adding the “User” you created to those files. I did this and when I created a user as documented via Settings → People → Users , it worked.

But… why? Why do all of those extra steps if simply creating a “People” will work?

1 Like

My current version is:

Home Assistant 2023.10.5
Supervisor 2023.10.0
Operating System 11.0
Frontend 20231005.0 - latest

Any updates? I also have the problem, that the client is disconnected, not authorized.
I’m trying to run zigbee2MQTT

I had this exact same problem.
I had 3 devices and mqtt explorer working just fine.
I was connecting a new device (my own code) to the broker and I kept getting connection refused errors (5) using the same HA user account and pwd.
For the heck of it I created a new user account and pwd and all of a sudden it worked. The new pwd was much simpler( only 5 lower case letters) since I did not think it would work. I will debug and figure what happened, howeve you may try this.