kafka-connector is only able to connect to kafka brokers using SASL_PLAIN when using SASL auth with a username and password.
This patch allows the kafka-connector to authenticate to kafka brokers using SCRAM-SHA-256 and SCRAM-SHA-512 SASL mechanisms.
Steps to reproduce:
- Compile kafka-connector for Linux amd64
- Configure kafka broker using SASL username & password with Kafka.EnableTLS set to true
- Start kafka-connector and attempt to connect to a kafka broker which requires auth with SCRAM-SHA-256 or SCRAM-SHA-512
Result:
kafka-connector immediately exits with the below error:
kafka-connector [173896]: ERROR: failed to initialize kafka producer: Failed to create new kafka producer: async producer init failed: kafka: client has run out of available brokers to talk to: kafka server: SASL Authentication failed: Authentication failed: Invalid username or password.
The username/password are correct despite the error message provided. The logs on the kafka end will also generate similar invalid username/password error messages