twmb / kcl

Your one stop shop to do anything with Kafka. Producing, consuming, transacting, administrating; 0.8.0 through 3.2+
BSD 3-Clause "New" or "Revised" License
194 stars 19 forks source link

UserCRAM was created success but cannot authenticate to cluster #9

Closed tommy04062019 closed 10 months ago

tommy04062019 commented 2 years ago

Command:

/kcl --config-path config.toml admin user-scram alter --set user=user1,mechanism=scram-sha-512,iterations=8192,password=123456

Error:

org.apache.kafka.common.errors.SaslAuthenticationException: Authentication failed during authentication due to invalid credentials with SASL mechanism SCRAM-SHA-512
twmb commented 2 years ago

What's the output of running the first command?

tommy04062019 commented 2 years ago

What's the output of running the first command?

It's here:

{
  "Version": 0,
  "ThrottleMillis": 0,
  "Results": [
    {
      "User": "user1",
      "ErrorCode": 0,
      "ErrorMessage": "",
      "UnknownTags": {}
    }
  ],
  "UnknownTags": {}
}

Something wrong with password.:(

tommy04062019 commented 2 years ago

Hi @twmb have u checked this? Your tool is great, It only lacks this part. I hope you have a look at it soon

twmb commented 2 years ago

Sorry, kcl is a bit lower priority for me at the moment. Everything above looks correct: what's the output of using the password? I remember when I tried this a bit ago that it was working. I could potentially try again -- not sure if I have a docker compose stashed around that enables the authorizer.

tommy04062019 commented 2 years ago

Sorry, kcl is a bit lower priority for me at the moment. Everything above looks correct: what's the output of using the password? I remember when I tried this a bit ago that it was working. I could potentially try again -- not sure if I have a docker compose stashed around that enables the authorizer.

Ahh!, I knew where your code wrong.

case "pasword":
  password = v

You missed s when check key password. After correcting, it works fine for me now. Thanks for responding

twmb commented 2 years ago

Looks like an easy fix, mind opening a PR?