title: Connect to Kakfka broker with SASL_PLAINTEXT in docker-compose (binami/kafka)
body: <p>I am implementing username/password in Kafka.</p>
  <p>When I tried with <code>PLAINTEXT</code> works as expected, but when I implement <code>SASL_PLAINTEXT</code> I can't connect.</p>
  <p>This is my docker-compose:</p>
  <pre class="lang-yaml prettyprint-override"><code>version: &quot;3.8&quot;
  services:
      zookeeper:
        container_name: zookeeper
        image: bitnami/zookeeper:latest
        ports:
          - 2181:2181
        environment:
          - ALLOW_ANONYMOUS_LOGIN=yes
      kafka4userpass: 
        container_name: kafka4userpass
        image: bitnami/kafka:latest
        ports:
          - '9096:9096'
        environment:
          - KAFKA_BROKER_ID=4
          - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
          - KAFKA_ZOOKEEPER_PROTOCOL:SASL_PLAINTEXT
          - ALLOW_PLAINTEXT_LISTENER=yes
          - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:SASL_PLAINTEXT
          - KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9096
          - KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka4userpass:9092,EXTERNAL://localhost:9096
          - KAFKA_INTER_BROKER_LISTENER_NAME=CLIENT
          - KAFKA_CLIENT_USERS=kafkauser
          - KAFKA_CLIENT_PASSWORDS=kafkapassword
        volumes:
          - './test/docker-compose/kafka_jaas.conf:/opt/bitnami/kafka/conf/kafka_jaas.conf:ro'
        depends_on:
          - zookeeper
      kafdrop:
        container_name: kafdrop
        image: obsidiandynamics/kafdrop
        restart: &quot;no&quot;
        ports:
          - &quot;9000:9000&quot;
        environment:
          KAFKA_BROKERCONNECT: &quot;CLIENT://kafka1:9092,CLIENT://kafka2:9092,CLIENT://kafka3:9092,CLIENT://kafka4userpass:9092&quot;
          JVM_OPTS: &quot;-Xms16M -Xmx48M -Xss180K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify&quot;
        depends_on:
          #- &quot;kafka1&quot;
          #- &quot;kafka2&quot;
          #- &quot;kafka3&quot;
          - &quot;kafka4userpass&quot;
  </code></pre>
  <p>The one I have the issue with is <code>kafka4userpass</code>.</p>
  <p>and this is my <code>kafka_jass.conf</code></p>
  <pre><code>KafkaServer {
      org.apache.kafka.common.security.plain.PlainLoginModule required
      username=&quot;kafkauser&quot;
      password=&quot;kafkapassword&quot;;
  };
  
  
  Client {
      org.apache.zookeeper.server.auth.PlainLoginModule required
      username=&quot;kafkauser&quot;
      password=&quot;kafkapassword&quot;;
  };
  </code></pre>
  <p>I can see the broker in Kafdrop, but I cannot connect.</p>
  <p>I tried to use <code>Offset explorer 2.1</code> setting their jass config section to : <code>org.apache.kafka.common.security.plain.PlainLoginModule required username=&quot;kafkauser&quot; password=&quot;kafkapassword&quot;;</code></p>
  <ul>
  <li>note: I also changed the mechanism to <code>PLAIN</code></li>
  </ul>
  <p>But I am getting <code>Invalid Username or password</code>.</p>
  <p>Any idea which file I am missing or which configuration do I have wrong?</p>
  <p>Thanks.</p>