Cannot connect to Kafka Broker using SASL with OAUTHBEARER

See original GitHub issue

Hello,

I’m trying to connect to my Kafka Broker using SASL. I’m using the docker version 0.20.0. I can successfully connect to the broker when running

kafka-topics --bootstrap-server broker:9094 --command-config command_sasl.properties --list

The command_sasl.properties lokks like this:

security.protocol=SASL_SSL ssl.key.password=<pass> ssl.keystore.location=keystore.jks ssl.keystore.password=<pass> ssl.truststore.location=truststore.jks ssl.truststore.password=<pass> sasl.mechanism=OAUTHBEARER sasl.login.callback.handler.class=io.confluent.kafka.clients.plugins.auth.token.TokenUserLoginCallbackHandler sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required \ username="username" \ password="password" \ metadataServerUrls="https://broker:8090" ;

My appllication.yml looks like this (sorry for the missing indents):

akhq:
  connections:
    my-sasl:
      properties:
        bootstrap.servers: "broker:9094"
        security.protocol: SASL_SSL
        ssl.key.password: pass
        ssl.keystore.location: /akhq/keystore.p12
        ssl.keystore.password: pass
        ssl.keystore.type: PKCS12
        ssl.truststore.location: /akhq/truststore.jks
        ssl.truststore.password: pass
        sasl.mechanism: OAUTHBEARER
        sasl.login.callback.handler.class: io.confluent.kafka.clients.plugins.auth.token.TokenUserLoginCallbackHandler
        sasl.jaas.config: org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required username="username" password="password" metadataServerUrls="https://broker:8090" ;

But when I try to connect to the cluster, I get this error:

akhq_1 | 2021-12-23 15:49:14,712 ERROR r-thread-9 o.a.c.ErrorController Invalid value io.confluent.kafka.clients.plugins.auth.token.TokenUserLoginCallbackHandler for configuration sasl.login.callback.handler.class: Class io.confluent.kafka.clients.plugins.auth.token.TokenUserLoginCallbackHandler could not be found.

Any ideas?

Thanks and best regards

Jens

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jheinitzcommented, Dec 23, 2021

Hi! That was quick. Thanks a lot. Will be able to test not before beginning of January. Will give feedback then.

0reactions
jheinitzcommented, Jan 4, 2022

Hello @tchiotludo !

Not really sure for the julie issues, I don’t know the project myself.

I just confirmed with my colleague tha we successfully connected to the same Kafka Cluster using Julie.

To be honest, I don’t even know this auth since I don’t use, you have a sample application (producer / consumer / stream) in java that works with this libs ?

We are currently working on it. As soon as I have something to show, I will let you know.

Thanks and kind regards

Jens

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring OAUTHBEARER | Confluent Documentation
In this example, clients connect to the broker as user alice . ... The default implementation of SASL/OAUTHBEARER in Kafka creates and validates...
Read more >
[#KAFKA-7902] SASL/OAUTHBEARER can become unable to ...
SaslException : Unable to find OAuth Bearer token in Subject's private ... to end up in a state where it cannot connect to...
Read more >
Kafka SASL: OAUTHBEARER and PLAIN simultaniously
When you it this way you won't get your error. Sadly I get another error when the broker want to set up the...
Read more >
Using AMQ Streams on RHEL Red Hat AMQ 2021.q3
OAuth 2.0 Kafka broker configuration Expand section "4.10.2. ... To handle the OAUTHBEARER authentication mechanism, use the login callback ...
Read more >
How to connect to Kafka server using SASL SSL protocol
The video provides the steps to connect to the Kafka server using SASL_SSL protocol.First, we will see the Ambari configuration needed to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found