Subscriber message,CONNECT failed as CONNACK contained an Error Code: BAD_USER_NAME_OR_PASSWORD
Opened this issue · 2 comments
zqb666 commented
pglombardo commented
Hi @zqb666 - It depends on how the broker authorization is setup but for simple auth:
final Mqtt5BlockingClient client = Mqtt5Client.builder()
.identifier(getClientId())
.serverHost(HOST)
.serverPort(PORT)
.simpleAuth()
.username(USERNAME)
.password(ByteBuffer.wrap(PASSWORD.getBytes(StandardCharsets.UTF_8)))
.applySimpleAuth()
See also this blog post: Authentication with Username and Password
pglombardo commented
Hi @zqb666 - did this help out at all? Did you find a solution that works for you?