checkCredentials method

  1. @protected
void checkCredentials (
  1. String username,
  2. String password
)
@protected

Check the username and password validity

Implementation

@protected
void checkCredentials(String username, String password) {
  if (username != null) {
    MqttLogger.log("Authenticating with username '{$username}' "
        "and password '{$password}'");
    if (username.trim().length >
        MqttClientConstants.recommendedMaxUsernamePasswordLength) {
      MqttLogger.log(
          'MqttClient::checkCredentials - Username length (${username.trim().length}) '
          'exceeds the max recommended in the MQTT spec. ');
    }
  }
  if (password != null &&
      password.trim().length >
          MqttClientConstants.recommendedMaxUsernamePasswordLength) {
    MqttLogger.log(
        'MqttClient::checkCredentials - Password length (${password.trim().length}) '
        'exceeds the max recommended in the MQTT spec. ');
  }
}