Skip to content

Adding an authentication (username, password) for the MQTT broker #1

@happydrop

Description

@happydrop

Thank you for your project, it's exactly what I need!
I need authentication with user and password for my MQTT Broker. Could you please add that?

/app/node_modules/mqtt/build/lib/handlers/connack.js:43
const err = new shared_1.ErrorWithReasonCode(Connection refused: ${ack_1.ReasonCodes[rc]}, rc);
^
ErrorWithReasonCode: Connection refused: Not authorized
at handleConnack (/app/node_modules/mqtt/build/lib/handlers/connack.js:43:21)
at handle (/app/node_modules/mqtt/build/lib/handlers/index.js:42:35)
at work (/app/node_modules/mqtt/build/lib/client.js:227:40)
at writable._write (/app/node_modules/mqtt/build/lib/client.js:252:13)
at writeOrBuffer (/app/node_modules/mqtt/node_modules/readable-stream/lib/internal/streams/writable.js:334:12)
at _write (/app/node_modules/mqtt/node_modules/readable-stream/lib/internal/streams/writable.js:283:10)
at Writable.write (/app/node_modules/mqtt/node_modules/readable-stream/lib/internal/streams/writable.js:286:10)
at Socket.ondata (node:internal/streams/readable:809:22)
at Socket.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:368:12) {
5
}
Node.js v18.19.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions