Fix #381, avoid t print password on bad signin during connect

This commit is contained in:
andsel
2018-04-27 13:08:12 +02:00
parent c839c9eadd
commit fc59b51558
@@ -297,13 +297,13 @@ public class ProtocolProcessor {
failedCredentials(channel); failedCredentials(channel);
return false; return false;
} }
if (!m_authenticator.checkValid(clientId, msg.payload().userName(), pwd)) { final String login = msg.payload().userName();
LOG.error("Authenticator has rejected the MQTT credentials CId={}, username={}, password={}", if (!m_authenticator.checkValid(clientId, login, pwd)) {
clientId, msg.payload().userName(), pwd); LOG.error("Authenticator has rejected the MQTT credentials CId={}, username={}", clientId, login);
failedCredentials(channel); failedCredentials(channel);
return false; return false;
} }
NettyUtils.userName(channel, msg.payload().userName()); NettyUtils.userName(channel, login);
} else if (!this.allowAnonymous) { } else if (!this.allowAnonymous) {
LOG.error("Client didn't supply any credentials and MQTT anonymous mode is disabled. CId={}", clientId); LOG.error("Client didn't supply any credentials and MQTT anonymous mode is disabled. CId={}", clientId);
failedCredentials(channel); failedCredentials(channel);